diff --git a/system/HTTP/CURLRequest.php b/system/HTTP/CURLRequest.php index 4c011c985f1d..35b62ec3486f 100644 --- a/system/HTTP/CURLRequest.php +++ b/system/HTTP/CURLRequest.php @@ -482,7 +482,11 @@ protected function setResponseHeaders(array $headers = []) $title = trim(substr($header, 0, $pos)); $value = trim(substr($header, $pos + 1)); - $this->response->addHeader($title, $value); + if ($this->response instanceof Response) { + $this->response->addHeader($title, $value); + } else { + $this->response->setHeader($title, $value); + } } elseif (strpos($header, 'HTTP') === 0) { preg_match('#^HTTP\/([12](?:\.[01])?) (\d+) (.+)#', $header, $matches);