[Web-SIG] Multiple message-header fields handling

Phillip J. Eby pje at telecommunity.com
Tue Oct 2 23:08:53 CEST 2007

At 10:27 PM 10/2/2007 +0200, Manlio Perillo wrote:
>Robert Brewer ha scritto:
> >
>  > [...]
> > As you note, it's part of the HTTP spec that such headers
> > can be combined without changing the semantics. Here's a list of the
> > headers that need to be folded:
> >
> > comma_separated_headers = ['ACCEPT', 'ACCEPT-CHARSET', 'ACCEPT-ENCODING',
> >
>Note that some of these headers are response headers, and it is
>responsibility of the WSGI application to properly folding them, and not
>of the WSGI gateway.

On the contrary.  The gateway is responsible for sending *all* the 
header lines to the client.  If you're only taking the last one, your 
gateway is non-compliant.

If nginx can't handle multiple headers, the only way you can be WSGI 
compliant is to do the folding in the gateway, because the 
application is explicitly allowed to provide multiple header values 
for a given header name.

More information about the Web-SIG mailing list