Re: [Zope3-dev] Duplicate HTTP header handling
Shane Hathaway wrote: Thinking more... the request should provide two methods, one for retrieving a header value as a string (possibly comma-concatenated), and another for retrieving a header value as a list. Never mind... I see from the checkin log that you've fixed it using commas already. Also, the list interface is not necessary because RFC 2616 requires the application to handle commas the same way it would handle overloaded headers. Shane ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
Re: [Zope3-dev] Duplicate HTTP header handling
Stuart Bishop wrote: From reading section 4.2 of http://www.faqs.org/rfcs/rfc2616.html , I suspect the best way of handling this situation is to concatenate the duplicate headers into a comma seperated string. In fact, section 4.2 seems to suggest that proxies are allowed to combine headers using commas. Thanks for discovering that. In light of this, I think it would be better to generate a comma-separated string, as you suggest, rather than interpret overloaded headers as a list. Using a list is more obvious, but seems quite fragile, since code in random places would have to be prepared to accept either a string or a list. isinstance() cruft would appear. Thinking more... the request should provide two methods, one for retrieving a header value as a string (possibly comma-concatenated), and another for retrieving a header value as a list. Shane ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
Re: [Zope3-dev] Duplicate HTTP header handling
On Friday 12 August 2005 04:03, Stuart Bishop wrote: > Currently if Z3 parses multiple headers with the same key, only the last is > used. Eek!!! > >From reading section 4.2 of http://www.faqs.org/rfcs/rfc2616.html , I > > suspect the best way of handling this situation is to concatenate the > duplicate headers into a comma seperated string. Or create a list. > I've noticed this when running Z3 behind cascading proxies and found I was > losing X-Forwarded-For headers. > > Does this seem like reasonable behavior? Some people may actually be > relying on this (broken) behavior, but I have a need of accessing all the > headers and don't want to have to use yet another tier to concatenate the > headers as allowed by the RFC ;) Please feel free to fix this ridiculous bug. Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
Re: [Zope3-dev] Duplicate HTTP header handling
Stuart Bishop wrote: > Hi. > > Currently if Z3 parses multiple headers with the same key, only the last is > used. > >>From reading section 4.2 of http://www.faqs.org/rfcs/rfc2616.html , I > suspect the best way of handling this situation is to concatenate the > duplicate headers into a comma seperated string. > > I've noticed this when running Z3 behind cascading proxies and found I was > losing X-Forwarded-For headers. > > Does this seem like reasonable behavior? Some people may actually be relying > on this (broken) behavior, but I have a need of accessing all the headers > and don't want to have to use yet another tier to concatenate the headers as > allowed by the RFC ;) Looks like this has bitten people under Z2 as well: http://www.zope.org/Collectors/Zope/908 -- Stuart Bishop <[EMAIL PROTECTED]> http://www.stuartbishop.net/ signature.asc Description: OpenPGP digital signature ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
[Zope3-dev] Duplicate HTTP header handling
Hi. Currently if Z3 parses multiple headers with the same key, only the last is used. >From reading section 4.2 of http://www.faqs.org/rfcs/rfc2616.html , I suspect the best way of handling this situation is to concatenate the duplicate headers into a comma seperated string. I've noticed this when running Z3 behind cascading proxies and found I was losing X-Forwarded-For headers. Does this seem like reasonable behavior? Some people may actually be relying on this (broken) behavior, but I have a need of accessing all the headers and don't want to have to use yet another tier to concatenate the headers as allowed by the RFC ;) -- Stuart Bishop <[EMAIL PROTECTED]> http://www.stuartbishop.net/ signature.asc Description: OpenPGP digital signature ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com