From 316fefc7ca9c9a87a9b10d8b8d110f92e791c55f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 15 Sep 2020 18:29:27 +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 --- HttpServer/Http/Response.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/HttpServer/Http/Response.php b/HttpServer/Http/Response.php index ec4efd8c..9b631e14 100644 --- a/HttpServer/Http/Response.php +++ b/HttpServer/Http/Response.php @@ -121,7 +121,12 @@ class Response extends Application unset($this->response); }); if ($this->response instanceof SResponse) { - return $this->sendData($this->response, $sendData, $statusCode); + $this->response->status($statusCode); + $this->response->header('Content-Type', $this->getContentType()); + $this->response->header('Access-Control-Allow-Origin', '*'); + $this->response->header('Run-Time', $this->getRuntime()); + $this->response->end($sendData); + return $sendData; } else { return $this->printResult($sendData); } @@ -174,11 +179,6 @@ class Response extends Application */ private function sendData($response, $sendData, $status) { - $response->status($status); - $response->header('Content-Type', $this->getContentType()); - $response->header('Access-Control-Allow-Origin', '*'); - $response->header('Run-Time', $this->getRuntime()); - $response->end($sendData); return $sendData; }