diff options
author | Alan Pearce | 2024-12-06 20:41:06 +0100 |
---|---|---|
committer | Alan Pearce | 2024-12-06 20:41:06 +0100 |
commit | 46241ba82f5b6d23e0c531f4fce033a5c102004d (patch) | |
tree | bf5ccb947a300d6b1948ac3436c7c41d58762943 /internal/server | |
parent | 60251afdc19df17428a41418ba04fdf322d35b0d (diff) | |
download | website-46241ba82f5b6d23e0c531f4fce033a5c102004d.tar.lz website-46241ba82f5b6d23e0c531f4fce033a5c102004d.tar.zst website-46241ba82f5b6d23e0c531f4fce033a5c102004d.zip |
fix random subdomain redirects caused by wildcard domain
Diffstat (limited to 'internal/server')
-rw-r--r-- | internal/server/server.go | 2 |
1 files changed, 1 insertions, 1 deletions
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: |