<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?> header causes proxy server to loose parts of buffer. After upgrade to 1.3.26 our XML API stopped working and we isolated the following problem: The following API XML response when passing through Proxy server: <?xml version="1.0" encoding="iso-8859-1" standalone="yes"?><response><Auth status="0"/><Version status="0"><number>1.61</number><url>http://release.openair1.com/download/OpenAi rOffLine161.exe</url><size>1246882</size></Version><Read status="0"><Slip><type>T</type><description/><total>0.00</total><projectid/><tax _location_name/><updated><Date><year>2002</year><minute>18</minute><second>35</s econd><hour>10</hour><month>01</month><day>07</day></Date></updated><notes>Raz Dva Tri Chetyre</notes><currency>USD</currency><total_with_tax/><categoryid/><rate>0.00< /rate><payment_typeid/><userid>1</userid><gl_code>1234455454</gl_code><unitm/><i d>11</id><timer_start/><minute/><projecttaskid/><created><Date><year>2000</year> <minute>45</minute><second>53</second><hour>10</hour><month>11</month><day>17</d ay></Date></created><cost>0.000</cost><city/><invoiceid/><itemid/><date><Date><y ear>2000</year><minute/><second/><hour/><month>11</month><day>13</day></Date></d ate><hour>4</hour><customerid>40</customerid><quantity>0.00</quantity></Slip></r esponse> would return nothing, or would cut off buffer returning only the end of the full response. When we tried to connect to webserver directly (bypassing proxy), the whole response was returned with no porblems. Then we tried putting a line break after initial: <?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>. As the result the whole response below that line was intact but this line got chewed off by proxy. Then we put the following sequence: <?xml version="1.0" encoding="iso-8859-1" standalone="yes"?> \n <?xml version="1.0" encoding="iso-8859-1" standalone="yes"?> <the rest of the response> (Two identical headers with line break in between and then full response) The first header got chewed off, the second one remained there and the rest of the response was fine. This hack enabled us to get back to working API. We can replicate this problem on all machines running new version of Apachi.
Created attachment 2321 [details] Fix drop of leading line of response for non-http proxied responses
I have supplied a patch for correcting this bug, basically if a non-HTTP response is received 1.3.26 will drop the 1st line even though it is not a header, refer to my attachement for a non-certified quick fix. The basic fix was to write a 'peek' function to look at a line without consuming the input buffer when checking for a true HTTP header response to a proxied request. I felt it was important to post it due to the inability to use 1.3.24 which doesn't have this bug - BUT has a nasty security flaw i.e. the CERT chunk bug.
mod_proxy is not designed to be a generic, all-purpose proxy. We will investigate this patch, but it is likely not to be included in 1.3 in deference to 2.0.
enabling the PatchAvailable keyword updated doc on submitting patches is at http://httpd.apache.org/dev/patches.html