about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2024-12-06 20:41:06 +0100
committerAlan Pearce2024-12-06 20:41:06 +0100
commit46241ba82f5b6d23e0c531f4fce033a5c102004d (patch)
treebf5ccb947a300d6b1948ac3436c7c41d58762943
parent60251afdc19df17428a41418ba04fdf322d35b0d (diff)
downloadwebsite-46241ba82f5b6d23e0c531f4fce033a5c102004d.tar.lz
website-46241ba82f5b6d23e0c531f4fce033a5c102004d.tar.zst
website-46241ba82f5b6d23e0c531f4fce033a5c102004d.zip
fix random subdomain redirects caused by wildcard domain
-rw-r--r--internal/server/server.go2
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: