hyper-reverse-proxy icon indicating copy to clipboard operation
hyper-reverse-proxy copied to clipboard

Host header is missing the port

Open aeschli opened this issue 2 years ago • 3 comments

The host header that is set by the proxy does not include the port.

The easiest fix is to just remove the host header as it will be automatically set by the client when sending the request: https://github.com/hyperium/hyper/blob/4fcfe1f4ba461209483dec960e36293459a1c60a/src/client/client.rs#L250

aeschli avatar Jun 22 '22 13:06 aeschli

Should host be the host of the target or host of the reverseproxy?

somehowchris avatar Jul 09 '22 16:07 somehowchris

From reading https://www.rfc-editor.org/rfc/rfc7230#section-5.4, my understanding is that a proxy needs to replace the host header with the name of the host to which it makes the request. The X-Forwarded-Host can be used to find out the host of the original request.

aeschli avatar Jul 11 '22 07:07 aeschli

Feels weird, but totally agree

somehowchris avatar Jul 18 '22 12:07 somehowchris