Skip to content

Commit

Permalink
Fixed the way Goutte\Client defined headers are added to Guzzle's req…
Browse files Browse the repository at this point in the history
…uest object to allow the overwrite of BrowserKit's Client server headers regardless of case.
  • Loading branch information
zachbadgett committed Jul 27, 2012
1 parent df14259 commit 3b81485
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Goutte/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand All @@ -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)
Expand Down

0 comments on commit 3b81485

Please sign in to comment.