From 46241ba82f5b6d23e0c531f4fce033a5c102004d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 6 Dec 2024 20:41:06 +0100 Subject: fix random subdomain redirects caused by wildcard domain --- internal/server/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/server/server.go b/internal/server/server.go index 21c7743..9c7b907 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -200,7 +200,7 @@ func New(runtimeConfig *Config, log *log.Logger) (*Server, error) { http.StatusMovedPermanently, ) case re.MatchString(r.Host): - url := config.BaseURL + url := config.BaseURL.JoinPath() url.Host = re.ReplaceAllString(r.Host, replace) http.Redirect(w, r, url.String(), http.StatusTemporaryRedirect) case true: -- cgit 1.4.1