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

incorrect host field passed through to upstream #1455

Open
JJ-Author opened this issue Aug 12, 2024 · 0 comments
Open

incorrect host field passed through to upstream #1455

JJ-Author opened this issue Aug 12, 2024 · 0 comments
Assignees
Labels
Bug Bug report in proxy server

Comments

@JJ-Author
Copy link

Describe the bug
incorrect host field is not replaced but passed through to upstream server

To Reproduce
start proxy.py and then on bash type
printf "GET http://httpbin.org/headers HTTP/1.1\r\nHost: foobar\r\nConnection: close\r\n\r\n" | nc -w 3 localhost 8899

outcome has foobar as host:
image

Expected behavior
according to https://datatracker.ietf.org/doc/html/rfc7230#section-5.4
When a proxy receives a request with an absolute-form of
request-target, the proxy MUST ignore the received Host header field
(if any) and instead replace it with the host information of the
request-target. A proxy that forwards such a request MUST generate a
new Host field-value based on the received request-target rather than
forward the received Host field-value.

@JJ-Author JJ-Author added the Bug Bug report in proxy server label Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug report in proxy server
Projects
None yet
Development

No branches or pull requests

2 participants