From 13fadb5ffcbdb7f14426d6d5d0d8be83f8f94663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Sat, 18 Sep 2021 10:43:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- http-handler/TestRequest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/http-handler/TestRequest.php b/http-handler/TestRequest.php index ebd90dc6..1c27a7e3 100644 --- a/http-handler/TestRequest.php +++ b/http-handler/TestRequest.php @@ -39,16 +39,16 @@ class TestRequest /** @var Handler $handler */ $handler = HandlerManager::get($request->server['request_uri'], $request->getMethod()); if (is_integer($handler)) { - $PsrResponse->withStatus($handler)->withBody(null); + $PsrResponse->withStatus($handler)->withBody(new Stream('Allow Method[' . $request->getMethod() . '].')); } else if (is_null($handler)) { - $PsrResponse->withStatus(404)->withBody(null); + $PsrResponse->withStatus(404)->withBody(new Stream('Page not found.')); } else { $PsrResponse = $this->handler($handler, $PsrRequest); } } catch (\Throwable $throwable) { $PsrResponse = \response()->withStatus($throwable->getCode()) ->withContentType(\Http\Message\Response::CONTENT_TYPE_HTML) - ->withBody(new Stream(jTraceEx($throwable,null,true))); + ->withBody(new Stream(jTraceEx($throwable, null, true))); } finally { $this->response->sender($response, $PsrResponse); }