return method not allowed error

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2023-03-09 08:42:04 +03:00
parent 25f306425b
commit 724ffb8c3a

View File

@ -117,7 +117,7 @@ func (h *httpServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
handler = hdlr handler = hdlr
break break
} else if err == rhttp.ErrMethodNotAllowed && !h.registerRPC { } 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 return
} }
} }