From fff5f6a8da7051f0ef0f46c125bf4596cd7029e1 Mon Sep 17 00:00:00 2001 From: Toon Schoenmakers Date: Tue, 29 Oct 2024 15:27:44 +0100 Subject: [PATCH] Only display landing page on / Signed-off-by: Toon Schoenmakers --- web/landing_page.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/landing_page.go b/web/landing_page.go index 68266213e..a001ff377 100644 --- a/web/landing_page.go +++ b/web/landing_page.go @@ -106,6 +106,11 @@ func NewLandingPage(c LandingConfig) (*LandingPageHandler, error) { } func (h *LandingPageHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { + if r.URL.Path != "/" { + w.Write([]byte("Not Found")) + w.WriteHeader(http.StatusNotFound) + return + } w.Header().Add("Content-Type", "text/html; charset=UTF-8") w.Write(h.landingPage) }