Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Using VCR with Guzzle results in duplicated Host headers. #43

Closed
wants to merge 1 commit into from
Closed

Conversation

gsaulmon
Copy link
Contributor

Using php-vcr in conjunction with Guzzle results in php-vcr duplicating the host header. \VCR\Util\CurlHelper::setCurlOptionOnRequest sets it during the CURLOPT_URL and CURLOPT_HTTPHEADER cases.

Example:

\VCR\VCR::configure()->enableLibraryHooks(array('curl_rewrite'));
\VCR\VCR::turnOn();
\VCR\VCR::insertCassette('Demo');

$client = new Guzzle\Http\Client();
$request = $client->get('http://www.google.com');
$response = $request->send();

The host header that gets sent over the wire in the above example is:
Host: www.google.com, www.google.com\r\n

@adri
Copy link
Contributor

adri commented Feb 20, 2014

Very nice find, thank you @gsaulmon. I'll look over it tonight and add tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants