From 55237e946f793c3a719d44e137ad488176e44530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 10 Sep 2020 11:45:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpServer/Events/OnRequest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/HttpServer/Events/OnRequest.php b/HttpServer/Events/OnRequest.php index 107554dc..b1547f4c 100644 --- a/HttpServer/Events/OnRequest.php +++ b/HttpServer/Events/OnRequest.php @@ -36,13 +36,13 @@ class OnRequest extends Callback public function onHandler(Request $request, Response $response) { try { - register_shutdown_function(OnRequest::class . '::shutdown', $response); - /** @var HRequest $sRequest */ [$sRequest, $sResponse] = static::setContext($request, $response); if ($sRequest->is('favicon.ico')) { return $params = $sResponse->send($sRequest->isNotFound(), 200); } + register_shutdown_function(OnRequest::class . '::shutdown', $response); + return $params = Snowflake::app()->getRouter()->dispatch(); } catch (Error | \Throwable $exception) { $params = $this->sendErrorMessage($sResponse ?? null, $exception, $response);