mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX: RequestHandler::__construct() should run after middlewares (fixes #8848)
This commit is contained in:
parent
19e5e9197f
commit
ca781c684d
@ -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