diff --git a/lib/http/http.go b/lib/http/http.go index 25e5ff82d..61525bab4 100644 --- a/lib/http/http.go +++ b/lib/http/http.go @@ -173,6 +173,9 @@ func NewServer(listeners, tlsListeners []net.Listener, opt Options) (Server, err router.MethodNotAllowed(func(w http.ResponseWriter, _ *http.Request) { http.Error(w, http.StatusText(http.StatusMethodNotAllowed), http.StatusMethodNotAllowed) }) + router.NotFound(func(w http.ResponseWriter, _ *http.Request) { + http.Error(w, http.StatusText(http.StatusNotFound), http.StatusNotFound) + }) handler := router.(http.Handler) if opt.BaseURL != "" {