From b4163d21624102f14e54274c802b810799d2b8ee Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Tue, 5 Sep 2023 06:01:30 +0400 Subject: [PATCH] StatusMethodNotAllowed was replaced by a correct StatusNotImplemented for if there is no tree for such method. --- httpr.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httpr.go b/httpr.go index 7cbaf89..f2b1352 100644 --- a/httpr.go +++ b/httpr.go @@ -187,7 +187,7 @@ func New() *Router { func (rr *Router) ServeHTTP(w http.ResponseWriter, r *http.Request) { tree, ok := rr.tree[r.Method] if !ok { - http.Error(w, http.StatusText(http.StatusMethodNotAllowed), http.StatusMethodNotAllowed) + http.Error(w, http.StatusText(http.StatusNotImplemented), http.StatusNotImplemented) return }