Skip to content

Commit fff5f6a

Browse files
author
Toon Schoenmakers
committed
Only display landing page on /
Signed-off-by: Toon Schoenmakers <[email protected]>
1 parent ad41e17 commit fff5f6a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

web/landing_page.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ func NewLandingPage(c LandingConfig) (*LandingPageHandler, error) {
106106
}
107107

108108
func (h *LandingPageHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
109+
if r.URL.Path != "/" {
110+
w.Write([]byte("Not Found"))
111+
w.WriteHeader(http.StatusNotFound)
112+
return
113+
}
109114
w.Header().Add("Content-Type", "text/html; charset=UTF-8")
110115
w.Write(h.landingPage)
111116
}

0 commit comments

Comments
 (0)