Skip to content

fix: HTTP 301 Redirect lead $response has header #47

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

Merged
merged 1 commit into from
Apr 29, 2014

Conversation

bangbang93
Copy link
Contributor

$response_header = 'HTTP 301...';
$response = 'HTTP 200.....';

$response_header = 'HTTP 301...';
$response = 'HTTP 200.....<body>';
@zborboa-g
Copy link
Contributor

Hi @bangbang93 thank you for the pull request. Can you provide a use case for this change? Thanks

@bangbang93
Copy link
Contributor Author

for example
$curl->setOpt(CURLOPT_FOLLOWLOCATION, 1);
$curl->get('http://www.bangbang93.com'); //this page has a 301 redirect to /forum.php
$res = $curl->response;
echo $res;

before my commit,the second HTTP header become a part of response body.Like this.look at the top of this page
qq20140429015422
after that it can get the page currectly
qq20140429015647

if the body is a json or xml document,this may make program unable to decode

@php-curl-class php-curl-class merged commit 257c255 into php-curl-class:master Apr 29, 2014
zachborboa added a commit that referenced this pull request Apr 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants