[ZCM] [ZC] 1866/ 4 Comment "304 responses should not have
Content-Length header"
Collector: Zope Bugs, Features,
and Patches ...
zope-coders-admin at zope.org
Sun Aug 14 18:02:19 EDT 2005
Issue #1866 Update (Comment) "304 responses should not have Content-Length header"
Status Pending, ZServer/bug+solution medium
To followup, visit:
http://www.zope.org/Collectors/Zope/1866
==============================================================
= Comment - Entry #4 by jens on Aug 14, 2005 6:02 pm
Well, if you have the time to check every single response status and see if it needs a content-length header set, or if you want to make 100% sure none of the other "unwanted" headers are set for a 304 response, feel free to submit an improved patch. I don't have that time so I was concentrating on the specific problem at hand, the content-length header for 304 responses.
________________________________________
= Comment - Entry #3 by dunny on Aug 14, 2005 4:43 pm
Some thoughts about the patch:
Probably want to check the handling of the Connection header. Don't need to use "Connection: close" for a 304 for example?
Might as well handle the other status that also don't want a content length: 100, 101, 102, 204?
Should the approach be more forceful and explicitly remove any Content-Length header? (At the moment the patch avoids adding Content-Length but that does not stop application code from getting it wrong.)
________________________________________
= Comment - Entry #2 by jens on Aug 14, 2005 11:41 am
Uploaded: "zserver_response.patch"
- http://www.zope.org/Collectors/Zope/1866/zserver_response.patch/view
Attaching patch
________________________________________
= Request - Entry #1 by jens on Aug 14, 2005 11:40 am
According to RFC 2616, 304 responses should not have a Content-Length header (and a few others Zope is sending, but this is strictly about content-length). While it is possible to prevent setting a content-length header in application code (such as in OFS.Image etc), ZServer.HTTPResponse is overly helpful and forces one if it does not exist.
The included patch and test (against the Zope 2.7 branch as of August 14th, 2005) fixes this and should apply cleanly against the Zope 2.8 branch and HEAD. Cannot test that right now because I am on dialup and svn.zope.org just hangs when I am trying to get it.
This report is an extension of a CMF collector report:
http://www.zope.org/Collectors/CMF/372
==============================================================
More information about the Zope-Collector-Monitor
mailing list