This commit is contained in:
2023-10-17 20:13:29 +08:00
parent 65d1585722
commit 879e347e3b
+2 -1
View File
@@ -97,9 +97,10 @@ class OnRequest implements OnRequestInterface
try {
/** @var ConstrictRequest $PsrRequest */
$PsrRequest = $this->initPsr7RequestAndPsr7Response($request);
$dispatcher = $this->router->query($request->server['path_info'], $request->getMethod());
$PsrResponse = (new HttpRequestHandler($dispatcher->getMiddlewares(), $dispatcher))->handle($PsrRequest);
$PsrResponse = $dispatcher->run($PsrRequest);
} catch (\Throwable $throwable) {
$PsrResponse = $this->exception->emit($throwable, di(ConstrictResponse::class));
} finally {