From 340df874c87da209e28aa7bebe28d96b86b22630 Mon Sep 17 00:00:00 2001 From: Bagas Aulia Rezki Date: Tue, 8 Oct 2024 14:05:12 +0700 Subject: [PATCH] Prevent overlapping default 404 message with custom HTML content --- routes/client/routes.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/routes/client/routes.go b/routes/client/routes.go index 24d5398..4ddff2d 100644 --- a/routes/client/routes.go +++ b/routes/client/routes.go @@ -32,6 +32,9 @@ import ( func SetupRoutes() *http.ServeMux { handler := http.NewServeMux() handler.HandleFunc("GET /{$}", indexHandler.GET) + handler.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotFound) + }) authRoute := http.NewServeMux() handler.Handle("/auth/", http.StripPrefix("/auth", authRoute))