fix: support X-Forwarded-Host with CODER_REDIRECT_TO_ACCESS_URL (#7035)

Fixes #7026.
This commit is contained in:
Kyle Carberry
2023-04-06 12:07:24 -05:00
committed by GitHub
parent aa660e0631
commit c68ab7d9a8
+5
View File
@@ -1729,6 +1729,11 @@ func redirectToAccessURL(handler http.Handler, accessURL *url.URL, tunnel bool,
return
}
if r.Header.Get("X-Forwarded-Host") == accessURL.Host {
handler.ServeHTTP(w, r)
return
}
if appHostnameRegex != nil && appHostnameRegex.MatchString(r.Host) {
handler.ServeHTTP(w, r)
return