You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
The text was updated successfully, but these errors were encountered: