/ Zope / Apsis / Pound Mailing List / Archive / 2012 / 2012-04 / Pound breaks HTTP spec related to Content-Length and Transfer-Encoding (PATCH)

[ << ] [ >> ]

[ pound with heartbeat/pacemaker / ... ] [ spdy with pound? / Thomas Ritz ... ]

Pound breaks HTTP spec related to Content-Length and Transfer-Encoding (PATCH)
Mike Lundy <mike(at)fluffypenguin.org>
2012-04-27 01:38:32 [ FULL ]
There doesn't seem to be a pound bugtracker, so this is a bug report.
I've attached a patch.

The HTTP/1.1 spec (4.4.3) says:
"If a message is received with both a Transfer-Encoding header field
and a Content-Length header field, the latter MUST be ignored."

It means the latter of the two fields mentioned (so, Content-Length
should be dropped). Pound is instead dropping the latter header that
is received, e.g.

$ len="-HContent-Length: 4"
$ chunk="-HTransfer-Encoding: chunked"

$ curl -d 'meow' $chunk $len http://localhost:8888

(Headers recieved by backend)
Host: localhost:8888
Transfer-Encoding: chunked
Content-Type: application/x-www-form-urlencoded
X-Forwarded-For: 127.0.0.1

$ curl -d 'meow' $len $chunk http://localhost:8888

(Headers received by backend)
Host: localhost:8888
Content-Length: 4
Content-Type: application/x-www-form-urlencoded
X-Forwarded-For: 127.0.0.1


Thanks!
Attachments:  
0001-Fix-HTTP-spec-violation-chunked-encoding-vs.-content.patch application/octet-stream 2245 Bytes

MailBoxer