diff --git a/HttpServer/Http/Response.php b/HttpServer/Http/Response.php index 5426915a..2e07f55c 100644 --- a/HttpServer/Http/Response.php +++ b/HttpServer/Http/Response.php @@ -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