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!

Attachment: 0001-Fix-HTTP-spec-violation-chunked-encoding-vs.-content.patch
Description: Binary data

Reply via email to