Permalink
Browse files

Fixed the way Goutte\Client defined headers are added to Guzzle's req…

…uest object to allow the overwrite of BrowserKit's Client server headers regardless of case.
  • Loading branch information...
1 parent df14259 commit 3b8148578676844cfb6b35ac998c64ce5be96dae @zachbadgett zachbadgett committed Jul 27, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 Goutte/Client.php
View
@@ -91,10 +91,14 @@ protected function doRequest($request)
$guzzleRequest = $this->getClient()->createRequest(
$request->getMethod(),
$request->getUri(),
- array_merge($this->headers, $headers),
+ $headers,
$body
);
+ foreach ($this->headers as $name => $value) {
+ $guzzleRequest->setHeader($name, $value);
+ }
+
if ($this->auth !== null) {
$guzzleRequest->setAuth(
$this->auth['user'],
@@ -119,8 +123,6 @@ protected function doRequest($request)
}
}
- $guzzleRequest->setHeader('User-Agent', $this->server['HTTP_USER_AGENT']);
-
$guzzleRequest->getCurlOptions()
->set(CURLOPT_FOLLOWLOCATION, false)
->set(CURLOPT_MAXREDIRS, 0)

0 comments on commit 3b81485

Please sign in to comment.