Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c68ab7d

Browse files
authored
fix: support X-Forwarded-Host with CODER_REDIRECT_TO_ACCESS_URL (coder#7035)
Fixes coder#7026.
1 parent aa660e0 commit c68ab7d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cli/server.go

+5
Original file line numberDiff line numberDiff line change
@@ -1729,6 +1729,11 @@ func redirectToAccessURL(handler http.Handler, accessURL *url.URL, tunnel bool,
17291729
return
17301730
}
17311731

1732+
if r.Header.Get("X-Forwarded-Host") == accessURL.Host {
1733+
handler.ServeHTTP(w, r)
1734+
return
1735+
}
1736+
17321737
if appHostnameRegex != nil && appHostnameRegex.MatchString(r.Host) {
17331738
handler.ServeHTTP(w, r)
17341739
return

0 commit comments

Comments
 (0)