[Web-SIG] Multiple message-header fields handling

Manlio Perillo manlio_perillo at libero.it
Tue Oct 2 23:01:33 CEST 2007

Phillip J. Eby ha scritto:
> At 10:03 PM 10/2/2007 +0200, Manlio Perillo wrote:
>> Manlio Perillo ha scritto:
>> > [...]
>> > As an example Nginx stores all the headers in a associative array,
>> > where, of course, only the "last seen" headers appears.
>> >
>> A correction: Nginx stores "raw" headers in a list of key/value pairs,
>> and not in an associative array.
>> This means that when I iterate over the headers, I see all the multiple
>> message-headers, but I only store the last header in the WSGI 
>> environment.
> That's definitely an error.

Right, its an error.

A simple solution is to first check if an header is already in the 
environ. If this is the case, then I can combine the new value with the 
old one.

The problem, is that I have first to check if the header can be combined 
(and the Cookie must be combined using ';' instead of ',').

Luckily some of these headers can be handled internally by Nginx.
How many browsers split an header on multiple lines?

Regards  Manlio Perillo

More information about the Web-SIG mailing list