mirror of
https://github.com/coder/coder.git
synced 2026-09-22 05:05:20 +08:00
fix: support X-Forwarded-Host with CODER_REDIRECT_TO_ACCESS_URL (#7035)
Fixes #7026.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user