This commit is contained in:
2021-07-27 16:29:47 +08:00
parent 65aaebef0b
commit 7d967d2762
+5 -6
View File
@@ -103,13 +103,12 @@ class HTTPServerListener extends Abstracts\Server
{ {
[$sRequest, $sResponse] = [HRequest::create($request), HResponse::create($response)]; [$sRequest, $sResponse] = [HRequest::create($request), HResponse::create($response)];
try { try {
if ($sRequest->is('favicon.ico')) { $node = $this->router->find_path($sRequest);
$this->router->status404(); if (empty($node)) {
} else if (!($node = $this->router->find_path($sRequest))) { $sResponse->send('404', 404);
$this->router->status404(); return;
} else {
$sResponse->send($node->dispatch(), 200);
} }
$sResponse->send($node->dispatch(), 200);
} catch (Error | Throwable $exception) { } catch (Error | Throwable $exception) {
$sResponse->addHeader('Content-Type', 'text/html; charset=utf-8'); $sResponse->addHeader('Content-Type', 'text/html; charset=utf-8');
$sResponse->send(jTraceEx($exception, null, true), $sResponse->send(jTraceEx($exception, null, true),