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/1.1 100 Continue Apache header renders native mode unusable #3

Open
ktarassow opened this issue May 9, 2010 · 0 comments
Open

Comments

@ktarassow
Copy link

Hi,

when using native mode to just pull some JSON 'as is' and the serving Apache for some reasons outputs a HTTP/1.1 100 Continue header before serving the actual response with 200 OK etc., the proxy parses the response incorrectly rendering it useless and causing JS errors on the client side.

Example:
//////// The proxy expects: ////////

HTTP/1.1 200 OK
Date: Sun, 09 May 2010 16:49:23 GMT
Server: Apache/2.2.12 (Ubuntu)
X-Powered-By: PHP/5.2.10-2ubuntu6.4
Content-Length: 11
Content-Type: application/json

{foo:'bar'}

///////////end//////////////////

/////// what it actually gets from cURL is: ////////////////

HTTP/1.1 100 Continue

HTTP/1.1 200 OK
Date: Sun, 09 May 2010 16:49:23 GMT
Server: Apache/2.2.12 (Ubuntu)
X-Powered-By: PHP/5.2.10-2ubuntu6.4
Content-Length: 11
Content-Type: application/json

{foo:'bar'}

//////////end ////////////
... thus resulting in the 100 header being $header and the rest incl. 200 header being $content, which is then returned to the client AJAX handler as part of the actually expected JSON response and breaking the handling function

//////possible solution/////

curl_setopt( $curl_handle, CURLOPT_HTTPHEADER, array( 'Expect:' ) );

///see also////

http://matthom.com/archive/2008/12/29/php-curl-disable-100-continue-expectation

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

1 participant