mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-09-16 21:36:33 +00:00
Use key/value when setting header
This commit is contained in:
+4
-2
@@ -211,8 +211,10 @@ class Curl
|
||||
|
||||
public function setHeader($key, $value)
|
||||
{
|
||||
$this->headers[$key] = $key . ': ' . $value;
|
||||
$this->setOpt(CURLOPT_HTTPHEADER, array_values($this->headers));
|
||||
$this->headers[$key] = $value;
|
||||
$this->setOpt(CURLOPT_HTTPHEADER, array_map(function($value, $key) {
|
||||
return $key . ': ' . $value;
|
||||
}, $this->headers, array_keys($this->headers)));
|
||||
}
|
||||
|
||||
public function unsetHeader($key)
|
||||
|
||||
Reference in New Issue
Block a user