Merge pull request 'return method not allowed error' (#152) from methodNotAllowed into v3

Reviewed-on: #152
This commit is contained in:
Василий Толстов 2023-03-09 08:42:50 +03:00
commit 647f731f50

View File

@ -117,7 +117,7 @@ func (h *httpServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
handler = hdlr
break
} else if err == rhttp.ErrMethodNotAllowed && !h.registerRPC {
h.errorHandler(ctx, nil, w, r, fmt.Errorf("not matching route found"), http.StatusNotFound)
h.errorHandler(ctx, nil, w, r, fmt.Errorf("not matching route found"), http.StatusMethodNotAllowed)
return
}
}