mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Moved locale middleware to before the not found handler, so that it never gets executed otherwise
This commit is contained in:
@@ -13,7 +13,6 @@ return [
|
|||||||
'middleware' => [
|
'middleware' => [
|
||||||
ErrorHandler::class,
|
ErrorHandler::class,
|
||||||
Expressive\Helper\ContentLengthMiddleware::class,
|
Expressive\Helper\ContentLengthMiddleware::class,
|
||||||
Common\Middleware\LocaleMiddleware::class,
|
|
||||||
],
|
],
|
||||||
'priority' => 12,
|
'priority' => 12,
|
||||||
],
|
],
|
||||||
@@ -47,6 +46,9 @@ return [
|
|||||||
'post-routing' => [
|
'post-routing' => [
|
||||||
'middleware' => [
|
'middleware' => [
|
||||||
Expressive\Router\Middleware\DispatchMiddleware::class,
|
Expressive\Router\Middleware\DispatchMiddleware::class,
|
||||||
|
|
||||||
|
// Only if a not found error is triggered, set-up the locale to be used
|
||||||
|
Common\Middleware\LocaleMiddleware::class,
|
||||||
Core\Response\NotFoundHandler::class,
|
Core\Response\NotFoundHandler::class,
|
||||||
],
|
],
|
||||||
'priority' => 1,
|
'priority' => 1,
|
||||||
|
|||||||
@@ -55,6 +55,6 @@ class NotFoundHandler implements RequestHandlerInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
$notFoundTemplate = $request->getAttribute(self::NOT_FOUND_TEMPLATE, $this->defaultTemplate);
|
$notFoundTemplate = $request->getAttribute(self::NOT_FOUND_TEMPLATE, $this->defaultTemplate);
|
||||||
return new Response\HtmlResponse($this->renderer->render($notFoundTemplate, ['request' => $request]), $status);
|
return new Response\HtmlResponse($this->renderer->render($notFoundTemplate), $status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user