From b92968a0e6d905d7efdd9ff475c3938bc8e05709 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 / --- 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) }