From 341bf97233db94d10e9dbf592f2b9651e6c1585a Mon Sep 17 00:00:00 2001 From: DrPsychick Date: Mon, 22 Sep 2025 22:15:17 +0200 Subject: [PATCH] fix: use request.URL.Host if set (#2069) --- cmd/proxy/actions/home.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/proxy/actions/home.go b/cmd/proxy/actions/home.go index ee9a7741..24486ca0 100644 --- a/cmd/proxy/actions/home.go +++ b/cmd/proxy/actions/home.go @@ -109,6 +109,11 @@ func proxyHomeHandler(c *config.Config) http.HandlerFunc { // This should be correct in most cases. If it is not, users can supply their own template templateData["Host"] = r.Host + // use host from URL, if it exists + if r.URL.Host != "" { + templateData["Host"] = r.URL.Host + } + // if the host does not have a scheme, add one based on the request if !strings.HasPrefix(templateData["Host"], "http://") && !strings.HasPrefix(templateData["Host"], "https://") { if r.TLS != nil {