Skip to content

Commit 44469ec

Browse files
committed
Use key/value when setting header
1 parent cc66aef commit 44469ec

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Curl/Curl.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,10 @@ public function setBasicAuthentication($username, $password = '')
211211

212212
public function setHeader($key, $value)
213213
{
214-
$this->headers[$key] = $key . ': ' . $value;
215-
$this->setOpt(CURLOPT_HTTPHEADER, array_values($this->headers));
214+
$this->headers[$key] = $value;
215+
$this->setOpt(CURLOPT_HTTPHEADER, array_map(function($value, $key) {
216+
return $key . ': ' . $value;
217+
}, $this->headers, array_keys($this->headers)));
216218
}
217219

218220
public function unsetHeader($key)

0 commit comments

Comments
 (0)