From da572ebdd95985b67805beabe993dd8baf169cf8 Mon Sep 17 00:00:00 2001 From: maru Date: Wed, 24 Apr 2024 18:54:24 -0400 Subject: [PATCH] Add default case to router --- api/endpoints.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/endpoints.go b/api/endpoints.go index f5f8aed..7bf452a 100644 --- a/api/endpoints.go +++ b/api/endpoints.go @@ -311,6 +311,9 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { } w.Write([]byte(strconv.Itoa(count))) + default: + httpError(w, r, fmt.Errorf("unknown endpoint"), http.StatusNotFound) + return } }