Skip to content

incorrect host field passed through to upstream #1455

Open
@JJ-Author

Description

@JJ-Author

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.

Metadata

Metadata

Assignees

Labels

BugBug report in proxy server

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions