Skip to content

Commit

Permalink
fix: Call to an undefined method
Browse files Browse the repository at this point in the history
 ------ --------------------------------------------------
  Line   system/HTTP/CURLRequest.php
 ------ --------------------------------------------------
  485    Call to an undefined method
         CodeIgniter\HTTP\ResponseInterface::addHeader().
 ------ --------------------------------------------------
  • Loading branch information
kenjis committed Nov 22, 2023
1 parent a769e53 commit 3c38acb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion system/HTTP/CURLRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 3c38acb

Please sign in to comment.