I had a problem with duplicate Content-Length headers in a
Quixote-Medusa HTTP response. It looks like Quixote uses a lowercase
header convention, and Medusa uses title case. This led to the following
problem:
>>> import urllib2
>>> r = urllib2.urlopen('http://localhost/')
>>> r.info()['content-length']
'1521, 1521'
And indeed there was both a 'content-length' and a 'Content-Length'
header set.
This patch switches Quixote headers into title case before passing over
to Medusa. This probably saves Medusa from recalc'ing the content-length
as well...
-- Graham
--- C:\projects\Quixote-0.6b5\server\medusa_http.py Mon Feb 10
08:57:30 2003
+++ C:\Python22\Lib\site-packages\quixote\server\medusa_http.py Mon Mar
17 11:54
:44 2003
@@ -96,5 +96,5 @@
# headers.
for v in values:
- request[hdr] = v
+ request[hdr.title()] = v
request.response(qreq.response.status_code)