This commit is contained in:
2020-09-02 18:43:23 +08:00
parent 0f63888022
commit 30f4a6a9a8
2 changed files with 355 additions and 330 deletions
+5
View File
@@ -28,12 +28,17 @@ class OnRequest extends Callback
/**
* @param Request $request
* @param Response $response
* @return void
* @throws Exception
*/
public function onHandler(Request $request, Response $response)
{
try {
/** @var HRequest $sRequest */
[$sRequest, $sResponse] = static::setContext($request, $response);
if ($sRequest->is('favicon.ico')) {
return $sResponse->send($sRequest->isNotFound(), 200);
}
$sResponse->send(Snowflake::get()->router->dispatch(), 200);
} catch (Error | \Throwable $exception) {
$this->sendErrorMessage($sResponse ?? null, $exception, $response);