docs: add todo for revamping the usage / naming of PassHostHeader

Signed-off-by: Jan Larwig <jan@larwig.com>
This commit is contained in:
Jan Larwig 2026-01-16 20:37:46 +01:00
parent 3bc1a5373a
commit 1f29953b7b
No known key found for this signature in database
GPG Key ID: C2172BFA220A037A
1 changed files with 4 additions and 0 deletions

View File

@ -157,6 +157,8 @@ func newReverseProxy(target *url.URL, upstream options.Upstream, errorHandler Pr
// Ensure we always pass the original request path
setProxyDirector(proxy)
// TODO (@tuunit) - this should be inverted or get a better name in the future to set the upstream host header
// only if PassHostHeader is explicitly set to true. Currently this would be a breaking change.
if !ptr.Deref(upstream.PassHostHeader, options.DefaultUpstreamPassHostHeader) {
setProxyUpstreamHostHeader(proxy, target)
}
@ -215,6 +217,8 @@ func newWebSocketReverseProxy(u *url.URL, skipTLSVerify *bool, passHostHeader *b
// Apply the customized transport to our proxy before returning it
wsProxy.Transport = transport
// TODO (@tuunit) - this should be inverted or get a better name in the future to set the upstream host header
// only if PassHostHeader is explicitly set to true. Currently this would be a breaking change.
// Set upstream host header if PassHostHeader is false (same as regular HTTP proxy)
if !ptr.Deref(passHostHeader, options.DefaultUpstreamPassHostHeader) {
setProxyUpstreamHostHeader(wsProxy, u)