From 67ee9860172ffe644ad930a04f7184a32e867d1d Mon Sep 17 00:00:00 2001 From: Kyle Carberry Date: Thu, 6 Apr 2023 16:51:22 +0000 Subject: [PATCH] fix: support `X-Forwarded-Host` with `CODER_REDIRECT_TO_ACCESS_URL` Fixes #7026. --- cli/server.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cli/server.go b/cli/server.go index c66ec6f625d5b..8ecdc1dfe771d 100644 --- a/cli/server.go +++ b/cli/server.go @@ -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 pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy