www-modproxy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brett Hutley <br...@hutley.net>
Subject Processing broken HTTP Headers while proxying...
Date Fri, 16 Aug 2002 00:30:02 GMT
Greetings all.

A couple of days ago I was trying to proxy Zope through Apache (1.3.26) 
on OpenBSD. Zope was listening on port 8080, and I had a rewrite rule in 
my http.conf file to proxy requests through to the Zope web server. 
Unfortunately, when I tried to test this setup, I ended up getting 
multiple HTTP headers in the response, which ended up appearing on the 
client browser.

What I discovered was that when mod_proxy was processing the headers, if 
it got a line that didn't have a colon in it, (other than the first 
line), it would return an NULL header list back to the calling function 
indicating that the headers were invalid. Unfortunately, the Zope server 
was sending back the string:

Server: Zope/(Zope 2.5.1b1 (OpenBSD package zope-2.5.1b1)
, python 2.1.2, openbsd3) ZServer/1.1b1

split on two lines, which meant mod_proxy wouldn't process the headers 
properly. Of course, this is a problem with the zope compilation rather 
than mod_proxy, but I was wondering just how strict the proxying code 
should be in parsing the headers from the remote server? It seems to me 
that if the header parsing stuff in proxy_util.c was slightly more 
forgiving of irregularities then life would be just that little bit 
better :)

Here is a patch to proxy_util.c that will allow certain header fields to 
have (up to) a certain number additional continuation lines... at the 
moment I've only defined the "Server" field name and specified that it 
can have up to 2 additional invalid lines after it, but more header 
fields can be added to fields_allowing_additional_lines array.

Cheers, Brett

View raw message