Fix error when X-Forwarded-Path is not defined
This commit is contained in:
parent
c5298dd24b
commit
da93835ea2
1 changed files with 3 additions and 1 deletions
|
@ -35,7 +35,9 @@ class RouterPathMiddleware
|
|||
*/
|
||||
public function __invoke(Request $request, Response $response, callable $next)
|
||||
{
|
||||
$this->router->setBasePath(current($request->getHeader('X-Forwarded-Path')));
|
||||
if ($path = current($request->getHeader('X-Forwarded-Path'))) {
|
||||
$this->router->setBasePath($path);
|
||||
}
|
||||
|
||||
return $next($request, $response);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue