[ZCM] [ZC] 1864/ 1 Request "appendHeader is case sensitive"
Collector: Zope Bugs, Features,
and Patches ...
zope-coders-admin at zope.org
Fri Aug 12 09:52:32 EDT 2005
Issue #1864 Update (Request) "appendHeader is case sensitive"
Status Pending, Zope/bug medium
To followup, visit:
http://www.zope.org/Collectors/Zope/1864
==============================================================
= Request - Entry #1 by lucrocha on Aug 12, 2005 9:52 am
Uploaded: "appendHeader.patch"
- http://www.zope.org/Collectors/Zope/1864/appendHeader.patch/view
setHeader() uses a lower case of the header name as the key to the headers dictionary. appendHeader, however, uses the name as it was called.
So, in some instances, it fails to keep any previous setting of that header.
One isntance where this causes problems is when compression is enabled. appendHeader will be called with args ('Vary', 'Accept-Encoding'), removing any previous setting of Vary.
A fix for this bug is in the attached patch (that includes a cosmetic change for the appending of headers, for the Live HTTP Headers firefox extension):
lib/python/ZPublisher/HTTPResponse.py, appendHeader() + 12
lname = name.lower()
if (headers.has_key(lname)):
name = lname
Zope-3.1.0c1 seems to have the same bug, in Dependencies/zope.publisher-Zope-3.1.0c1/zope.publisher/http.py, appendToHeader() (but I haven't tested Zope3, just checked the sources).
==============================================================
More information about the Zope-Collector-Monitor
mailing list