Skip to content

Commit

Permalink
Merge 13579bc into ae5a589
Browse files Browse the repository at this point in the history
  • Loading branch information
gsaulmon committed Feb 19, 2014
2 parents ae5a589 + 13579bc commit 4b84a10
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/VCR/Util/CurlHelper.php
Expand Up @@ -116,11 +116,16 @@ public static function setCurlOptionOnRequest(Request $request, $option, $value)
$headers = array();
foreach ($value as $header) {
$headerParts = explode(': ', $header, 2);

if (isset($headerParts[1])) {
$headers[$headerParts[0]] = $headerParts[1];
if (strtolower($headerParts[0]) == 'host') {
$request->setHeader($headerParts[0], $headerParts[1]);
} else {
$request->addHeader($headerParts[0], $headerParts[1]);
}
}
}
$request->addHeaders($headers);

break;
case CURLOPT_WRITEFUNCTION:
case CURLOPT_HEADERFUNCTION:
Expand Down

0 comments on commit 4b84a10

Please sign in to comment.