mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #8849 from kinglozzer/middleware-requesthandler-order
FIX: RequestHandler::__construct() should run after middlewares (fixes #8848)
This commit is contained in:
commit
94e5d0a642
@ -352,12 +352,11 @@ class Director implements TemplateGlobalProvider
|
||||
break;
|
||||
}
|
||||
|
||||
/** @var RequestHandler $controllerObj */
|
||||
$controllerObj = Injector::inst()->create($arguments['Controller']);
|
||||
|
||||
// Handler for calling a controller
|
||||
$handler = function (HTTPRequest $request) use ($controllerObj) {
|
||||
// Handler for constructing and calling a controller
|
||||
$handler = function (HTTPRequest $request) use ($arguments) {
|
||||
try {
|
||||
/** @var RequestHandler $controllerObj */
|
||||
$controllerObj = Injector::inst()->create($arguments['Controller']);
|
||||
return $controllerObj->handleRequest($request);
|
||||
} catch (HTTPResponse_Exception $responseException) {
|
||||
return $responseException->getResponse();
|
||||
|
Loading…
Reference in New Issue
Block a user