diff --git a/library/think/Response.php b/library/think/Response.php index e0f5d7e2..a7ebecf7 100644 --- a/library/think/Response.php +++ b/library/think/Response.php @@ -284,7 +284,11 @@ class Response */ public function getHeader($name = '') { - return !empty($name) ? $this->header[$name] : $this->header; + if (!empty($name)) { + return isset($this->header[$name]) ? $this->header[$name] : null; + } else { + return $this->header; + } } /**