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)];
try {
if ($sRequest->is('favicon.ico')) {
$this->router->status404();
} else if (!($node = $this->router->find_path($sRequest))) {
$this->router->status404();
} else {
$sResponse->send($node->dispatch(), 200);
$node = $this->router->find_path($sRequest);
if (empty($node)) {
$sResponse->send('404', 404);
return;
}
$sResponse->send($node->dispatch(), 200);
} catch (Error | Throwable $exception) {
$sResponse->addHeader('Content-Type', 'text/html; charset=utf-8');
$sResponse->send(jTraceEx($exception, null, true),