about summary refs log tree commit diff stats
path: root/internal/server/tls.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/server/tls.go')
-rw-r--r--internal/server/tls.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/server/tls.go b/internal/server/tls.go
index 56c2215..183ce70 100644
--- a/internal/server/tls.go
+++ b/internal/server/tls.go
@@ -131,7 +131,11 @@ func (s *Server) serveTLS() (err error) {
 				}
 				url.Host = net.JoinHostPort(host, s.config.BaseURL.Port())
 			}
-			http.Redirect(w, r, url.String(), http.StatusMovedPermanently)
+			if slices.Contains(s.config.Domains, r.Host) {
+				http.Redirect(w, r, url.String(), http.StatusMovedPermanently)
+			} else {
+				http.NotFound(w, r)
+			}
 		})
 		srv.Handler = httpMux