改进Response类getHeader方法

This commit is contained in:
thinkphp
2016-12-07 17:00:25 +08:00
parent 90b0da7bed
commit c951001f6c

View File

@@ -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;
}
}
/**