This commit is contained in:
2020-09-16 20:49:22 +08:00
parent 018a9573c7
commit 38ac99b497
+9 -4
View File
@@ -101,15 +101,20 @@ class Response extends Application
*/
public function addHeader($key, $value)
{
if (
!($this->response instanceof SResponse) ||
!($this->response instanceof S2Response)
) {
if ($this->isClient()) {
return;
}
$this->response->header($key, $value);
}
/**
* @return bool
*/
private function isClient()
{
return !($this->response instanceof SResponse) && !($this->response instanceof S2Response);
}
/**
* @param string $context
* @param int $statusCode