upadrian / php-proxy

Automatically exported from code.google.com/p/php-proxy
0 stars 0 forks source link

HTTP/1.1 100 Continue - - - NOT removed correctly -- FIXED #1

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
This is a FANTASTIC and clean and small poxy, however the included fix for 
extra 'continue headers' assumes that the extra header is only one line long.  
(mutli lines are often seen in ajax responses)

The fix is simple (even if mine is inellegant)

REMOVE

$response = str_replace( "HTTP/1.1 100 Continue\r\n\r\n", "", $response);

INSERT

if (   (substr( $response, 0, 21) == 'HTTP/1.1 100 Continue')
  && ($end_cont = strpos( $response, '\r\n\r\n'))
  ) {
     $response = substr($response, $end_cont + 4);
}

Many many thanks to the original author.

--
Roger

Original issue reported on code.google.com by roger.pf...@gmail.com on 11 Oct 2012 at 8:59

GoogleCodeExporter commented 8 years ago
Oops -   '\r\n\r\n'   above should be   "\r\n\r\n"

Original comment by roger.pf...@gmail.com on 11 Oct 2012 at 9:48