From 46d18a018ef6358a30f9bb1c87f8cabf9581e518 Mon Sep 17 00:00:00 2001 From: Chandler Swift Date: Thu, 12 Oct 2023 22:02:59 -0500 Subject: [PATCH] Add 404 handler for not-index --- minecraft-site.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/minecraft-site.go b/minecraft-site.go index a653bee..b422606 100644 --- a/minecraft-site.go +++ b/minecraft-site.go @@ -73,6 +73,9 @@ func main() { } http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + if r.URL.Path != "/" { + http.NotFound(w, r) + } // Update servers with current data for i, s := range config.Servers {