Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pound forwards requests containing both Transfer-Encoding and Content-Length headers #26

Closed
kenballus opened this issue Feb 4, 2024 · 0 comments

Comments

@kenballus
Copy link

When Pound receives a request containing both an unrecognized Transfer-Encoding value and a Content-Length value, both are forwarded to the backend. This violates RFC 9112, section 6.2:

A sender MUST NOT send a Content-Length header field in any message that contains a Transfer-Encoding header field.

To see this for yourself, start up Pound and send it the following request:

POST / HTTP/1.1\r\n
Host: a\r\n
Content-Length: 5\r\n
Transfer-Encoding: invalid!!\r\n
\r\n
0\r\n\r\n

You should see the following forwarded to the backend:

POST / HTTP/1.1\r\n
Host: a\r\n
Content-Length: 5\r\n
Transfer-Encoding: invalid!!\r\n
X-Forwarded-For: 172.19.0.1\r\n
X-Forwarded-Proto: http\r\n
X-Forwarded-Port: 80\r\n
\r\n
0\r\n\r\n

Note that both headers remain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant