StatusMethodNotAllowed was replaced by a correct StatusNotImplemented for if there is no tree for such method.

This commit is contained in:
Alexander Andreev 2023-09-05 06:01:30 +04:00
parent 5d613b34ee
commit b4163d2162
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

@ -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
}