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

HTTP headers passed with the body/content #21

Open
maysara opened this issue May 15, 2013 · 2 comments
Open

HTTP headers passed with the body/content #21

maysara opened this issue May 15, 2013 · 2 comments

Comments

@maysara
Copy link

maysara commented May 15, 2013

Hello,

I'm getting the http response headers in the content ... i'm not sure if this is intentional or configurable, but this does not make sense to my current use, as i do not expect the http headers in the response, rather either mimicked in the http response from simple php proxy; or discarded. please advise.

@maysara
Copy link
Author

maysara commented May 17, 2013

Hello,

The issue is/was the 100 continue http response/header, a hack by exploing the result into 3 and ignoring the first works, but this is a very case specific workaround; i thought i'll let you know.

@laurent-grousset
Copy link

modify the script to make this working :

replace : list( $header, $contents ) = preg_split( '/([\r\n][\r\n])\1/', curl_exec( $ch ), 2 );

with :

$response = curl_exec($ch);
$header_size = curl_getinfo($ch,CURLINFO_HEADER_SIZE);
$header = substr($response, 0, $header_size);
$contents = substr( $response, $header_size );

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

No branches or pull requests

2 participants