all repos — website @ 46241ba82f5b6d23e0c531f4fce033a5c102004d

My website

fix random subdomain redirects caused by wildcard domain
Alan Pearce alan@alanpearce.eu
Fri, 06 Dec 2024 20:41:06 +0100
commit

46241ba82f5b6d23e0c531f4fce033a5c102004d

parent

60251afdc19df17428a41418ba04fdf322d35b0d

1 files changed, 1 insertions(+), 1 deletions(-)

jump to
M internal/server/server.gointernal/server/server.go
@@ -200,7 +200,7 @@ config.BaseURL.JoinPath(path).String(), 					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: