From e14525f1125ade32c3c255084bea4590309f2eda Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 16 Apr 2021 16:57:50 +0200 Subject: [PATCH] allow wildcard of the configured domain, too --- cmd/server/main.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cmd/server/main.go b/cmd/server/main.go index 44d7709..8d103c7 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -299,7 +299,15 @@ func runroomsrv() error { secureMiddleware := secure.New(secure.Options{ IsDevelopment: development, - AllowedHosts: []string{httpsDomain}, + AllowedHosts: []string{ + // the normal domain + httpsDomain, + // the domain but as a wildcard match with *. infront + `*\.` + strings.Replace(httpsDomain, ".", `\.`, -1), + }, + + // for the wildcard matching + AllowedHostsAreRegex: true, // TLS stuff SSLRedirect: true,