providers/proxy: fix Issuer when AUTHENTIK_HOST_BROWSER is set (#11968)

correctly use host_browser's hostname as host header for token requests to ensure Issuer is identical
This commit is contained in:
Jens L.
2024-11-13 00:54:40 +01:00
committed by GitHub
parent 1f6ae73e6e
commit a892d4afd8
2 changed files with 14 additions and 3 deletions

View File

@ -14,8 +14,10 @@ type hostInterceptor struct {
}
func (t hostInterceptor) RoundTrip(r *http.Request) (*http.Response, error) {
r.Host = t.host
r.Header.Set("X-Forwarded-Proto", t.scheme)
if r.Host != t.host {
r.Host = t.host
r.Header.Set("X-Forwarded-Proto", t.scheme)
}
return t.inner.RoundTrip(r)
}