Multi-line headers patch

Piotr Sikora piotr.sikora at
Mon Sep 20 23:24:16 MSD 2010


> Just a quick note:
> Multi-line headers is going to be deprecated by upcoming HTTPbis
> specification.  See
> for details.

Yes, but only for senders. The draft you linked (as well as its most recent 
update) states that:

   HTTP/1.1 recipients
   SHOULD accept line folding and replace any embedded obs-fold
   whitespace with a single SP prior to interpreting the field value or
   forwarding the message downstream.

But please remember that this is still only a draft. Current standard allows 
senders to send multi-line headers, so I don't see why this shouldn't be 
supported by nginx.

> Could you please provide some details why do you actually need
> this patch?

Some RESTful webservices (including Amazon S3) are using HTTP headers to 
transfer meta-data, which sometimes span over multiple lines. Other than 
that, there are broken OAuth clients out there that emit each parameter in 
new line.

Attached patch is loosely based on algorist's version, but it also works for 
cases when whole request header wasn't yet received from the client and it 
unfolds multi-line headers (so it conforms to the HTTPbis drafts). I've also 
added '\t' as whitespace character, it seems that it should be treated like 

Best regards,
Piotr Sikora < piotr.sikora at >
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nginx__accept_and_unfold_multiline_headers.patch
Type: application/octet-stream
Size: 6156 bytes
Desc: not available
URL: <>

More information about the nginx mailing list