From 3c41d17802f338e44ecd3705f137b534345064a7 Mon Sep 17 00:00:00 2001 From: whale Date: Sun, 26 Apr 2020 17:25:41 +0800 Subject: [PATCH] fix a bug --- src/ZM/Event/Swoole/RequestEvent.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ZM/Event/Swoole/RequestEvent.php b/src/ZM/Event/Swoole/RequestEvent.php index 23fe9da8..22cfd612 100644 --- a/src/ZM/Event/Swoole/RequestEvent.php +++ b/src/ZM/Event/Swoole/RequestEvent.php @@ -64,9 +64,6 @@ class RequestEvent implements SwooleEvent } elseif ($node["son"][0]["name"] == $r) { $node = $node["son"][0]; continue; - } else { - $this->responseStatus(404); - return $this; } } elseif ($cnt >= 1) { if (isset($node["param_route"])) { @@ -85,6 +82,7 @@ class RequestEvent implements SwooleEvent } } } + if (ZMBuf::globals("static_file_server")["status"]) { $base_dir = ZMBuf::globals("static_file_server")["document_root"]; $base_index = ZMBuf::globals("static_file_server")["document_index"]; @@ -116,7 +114,8 @@ class RequestEvent implements SwooleEvent } } } - $this->responseStatus(404); + $this->response->status(404); + $this->response->end(ZMUtil::getHttpCodePage(404)); return $this; }