[Zope3-dev] Duplicate HTTP header handling

Shane Hathaway shane at hathawaymix.org
Fri Aug 12 11:27:28 EDT 2005


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


More information about the Zope3-dev mailing list