[Python-Dev] ZServer 1.0b1: spurious colon in HTTP response line

skip at mojam.com skip at mojam.com
Wed Apr 21 15:17:32 CEST 1999

(Also reported to the bug catcher.)

I'm trying to migrate from ZopeHTTPServer to ZServer 1.0b1.  I was seeing
the ZServer headers turning up in pages generated by the process.  When I
viewed the page source of the generated HTML I saw:

    HTTP/1.0: 200 OK
    Server: Zope/experimental ZServer/1.1b1
    Date: Wed, 21 Apr 1999 13:00:38 GMT
    X-Powered-By: Zope (www.zope.org), Python (www.python.org)
    Connection: close
    Content-Type: text/html
    Content-Length: 7802

    <!-- -*-html-helper -*- -->
    <TITLE>Musi-Cal... Concert Schedules: Folk Music, Country Music, Rock Music &amp; more!</TITLE>

I run ZServer behind an Apache 1.3.3 running mod_proxy.  Apparently Apache
doesn't recognize the HTTP response when there is a colon following the
version number and adds a simple set of headers itself.  I guess web
browsers either ignore that line or are more lenient in their parsing of the

The following simple patch corrects the problem:

diff -c2 HTTPResponse.py.~1~ HTTPResponse.py
*** HTTPResponse.py.~1~	Tue Apr 13 15:21:12 1999
--- HTTPResponse.py	Wed Apr 21 09:05:00 1999
*** 146,150 ****
          # status header must come first.
!         append("HTTP/%s: %s" % (self._http_version, status))
          if headers.has_key('status'):
              del headers['status']
--- 146,150 ----
          # status header must come first.
!         append("HTTP/%s %s" % (self._http_version, status))
          if headers.has_key('status'):
              del headers['status']

Skip Montanaro	| Mojam: "Uniting the World of Music" http://www.mojam.com/
skip at mojam.com  | Musi-Cal: http://www.musi-cal.com/

More information about the Python-Dev mailing list