Skip to content

Commit 3c38acb

Browse files
committed
fix: Call to an undefined method
------ -------------------------------------------------- Line system/HTTP/CURLRequest.php ------ -------------------------------------------------- 485 Call to an undefined method CodeIgniter\HTTP\ResponseInterface::addHeader(). ------ --------------------------------------------------
1 parent a769e53 commit 3c38acb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

system/HTTP/CURLRequest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,11 @@ protected function setResponseHeaders(array $headers = [])
482482
$title = trim(substr($header, 0, $pos));
483483
$value = trim(substr($header, $pos + 1));
484484

485-
$this->response->addHeader($title, $value);
485+
if ($this->response instanceof Response) {
486+
$this->response->addHeader($title, $value);
487+
} else {
488+
$this->response->setHeader($title, $value);
489+
}
486490
} elseif (strpos($header, 'HTTP') === 0) {
487491
preg_match('#^HTTP\/([12](?:\.[01])?) (\d+) (.+)#', $header, $matches);
488492

0 commit comments

Comments
 (0)