modify
This commit is contained in:
+622
-615
File diff suppressed because it is too large
Load Diff
@@ -106,16 +106,11 @@ class HTTPServerListener extends Abstracts\Server
|
|||||||
public function onRequest(Request $request, Response $response)
|
public function onRequest(Request $request, Response $response)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if (ApplicationStore::getStore()->getStatus() == 'exit') {
|
if (HRequest::create($request, $response)->is('favicon.ico')) {
|
||||||
$response->status(401);
|
$this->router->status404();
|
||||||
$response->end();
|
} else {
|
||||||
return;
|
$this->router->dispatch();
|
||||||
}
|
}
|
||||||
$request = HRequest::create($request, $response);
|
|
||||||
if ($request->is('favicon.ico')) {
|
|
||||||
throw new Exception('Not found.', 404);
|
|
||||||
}
|
|
||||||
$this->router->dispatch();
|
|
||||||
} catch (ExitException | Error | Throwable $exception) {
|
} catch (ExitException | Error | Throwable $exception) {
|
||||||
$response->setHeader('Content-Type', 'text/html; charset=utf-8');
|
$response->setHeader('Content-Type', 'text/html; charset=utf-8');
|
||||||
$response->status($exception->getCode() == 0 ? 500 : $exception->getCode());
|
$response->status($exception->getCode() == 0 ? 500 : $exception->getCode());
|
||||||
|
|||||||
Reference in New Issue
Block a user