From 1f29953b7b28b053d7b8c5e18c8742f450cb7eb9 Mon Sep 17 00:00:00 2001 From: Jan Larwig Date: Fri, 16 Jan 2026 20:37:46 +0100 Subject: [PATCH] docs: add todo for revamping the usage / naming of PassHostHeader Signed-off-by: Jan Larwig --- pkg/upstream/http.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/upstream/http.go b/pkg/upstream/http.go index b3c3ae74..9112756e 100644 --- a/pkg/upstream/http.go +++ b/pkg/upstream/http.go @@ -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)