From 557efc47a8e57cf14bbd10dd5404214e3b377328 Mon Sep 17 00:00:00 2001 From: jerry Date: Sat, 2 Jan 2021 19:40:13 +0800 Subject: [PATCH] update to 2.1.4 version --- composer.json | 2 +- src/ZM/Http/Response.php | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 80a0c499..27da3874 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "High performance QQ robot and web server development framework", "minimum-stability": "stable", "license": "Apache-2.0", - "version": "2.1.3", + "version": "2.1.4", "extra": { "exclude_annotate": [ "src/ZM" diff --git a/src/ZM/Http/Response.php b/src/ZM/Http/Response.php index a304e88d..89e65d89 100644 --- a/src/ZM/Http/Response.php +++ b/src/ZM/Http/Response.php @@ -94,7 +94,8 @@ class Response */ public function status($http_code, $reason = null) { $this->status_code = $http_code; - return $this->response->status($http_code, $reason); + if (!$this->is_end) return $this->response->status($http_code, $reason); + else return false; } public function getStatusCode() { @@ -107,7 +108,8 @@ class Response * @return mixed */ public function setStatusCode($http_code, $reason = null) { - return $this->response->setStatusCode($http_code, $reason); + if (!$this->is_end) return $this->response->setStatusCode($http_code, $reason); + else return false; } /** @@ -117,7 +119,8 @@ class Response * @return mixed */ public function header($key, $value, $ucwords = null) { - return $this->response->header($key, $value, $ucwords); + if (!$this->is_end) return $this->response->header($key, $value, $ucwords); + else return false; } /** @@ -127,7 +130,7 @@ class Response * @return mixed */ public function setHeader($key, $value, $ucwords = null) { - return $this->response->setHeader($key, $value, $ucwords); + return !$this->is_end ? $this->response->setHeader($key, $value, $ucwords) : false; } /** @@ -165,7 +168,7 @@ class Response public function isEnd() { return $this->is_end; } - public function endWithStatus($status_code = 200, $content = null){ + public function endWithStatus($status_code = 200, $content = null) { $this->status($status_code); $this->end($content); }