Restore "originalUri" request attribute

This is helpful when Flarum is installed in subfolders.

Fixes #778.
This commit is contained in:
Franz Liedke 2019-06-01 12:51:05 +02:00
parent 7850fc3b52
commit 8a4d6f5179

View File

@ -22,6 +22,7 @@ use Illuminate\Contracts\Container\Container;
use Middlewares\BasePath;
use Middlewares\BasePathRouter;
use Middlewares\RequestHandler;
use Zend\Stratigility\Middleware\OriginalMessages;
use Zend\Stratigility\MiddlewarePipe;
class InstalledApp implements AppInterface
@ -61,6 +62,7 @@ class InstalledApp implements AppInterface
$pipe = new MiddlewarePipe;
$pipe->pipe(new BasePath($this->basePath()));
$pipe->pipe(new OriginalMessages);
$pipe->pipe(
new BasePathRouter([
$this->subPath('api') => 'flarum.api.middleware',