git.iko.soy/typeable/oauth2-proxy
on master help sign in
docs: add todo for revamping the usage / naming of PassHostHeader

Signed-off-by: Jan Larwig <jan@larwig.com>

commit1f29953b7b28b053d7b8c5e18c8742f450cb7eb9 authorJan Larwig <jan@larwig.com> dateFri 16 Jan 2026, 20:37 (9 months ago) parent3bc1a53
1 file changed+4
pkg/upstream/http.go+4
pkg/upstream/http.go+4
@@ -157,6 +157,8 @@ func newReverseProxy(target *url.URL, upstream options.Upstream, errorHandler Pr
157157 // Ensure we always pass the original request path
158158 setProxyDirector(proxy)
159159
160+ // TODO (@tuunit) - this should be inverted or get a better name in the future to set the upstream host header
161+ // only if PassHostHeader is explicitly set to true. Currently this would be a breaking change.
160162 if !ptr.Deref(upstream.PassHostHeader, options.DefaultUpstreamPassHostHeader) {
161163 setProxyUpstreamHostHeader(proxy, target)
162164 }
@@ -215,6 +217,8 @@ func newWebSocketReverseProxy(u *url.URL, skipTLSVerify *bool, passHostHeader *b
215217 // Apply the customized transport to our proxy before returning it
216218 wsProxy.Transport = transport
217219
220+ // TODO (@tuunit) - this should be inverted or get a better name in the future to set the upstream host header
221+ // only if PassHostHeader is explicitly set to true. Currently this would be a breaking change.
218222 // Set upstream host header if PassHostHeader is false (same as regular HTTP proxy)
219223 if !ptr.Deref(passHostHeader, options.DefaultUpstreamPassHostHeader) {
220224 setProxyUpstreamHostHeader(wsProxy, u)