StatusMethodNotAllowed was replaced by a correct StatusNotImplemented for if there is no tree for such method.
This commit is contained in:
parent
5d613b34ee
commit
b4163d2162
2
httpr.go
2
httpr.go
@ -187,7 +187,7 @@ func New() *Router {
|
|||||||
func (rr *Router) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
func (rr *Router) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
tree, ok := rr.tree[r.Method]
|
tree, ok := rr.tree[r.Method]
|
||||||
if !ok {
|
if !ok {
|
||||||
http.Error(w, http.StatusText(http.StatusMethodNotAllowed), http.StatusMethodNotAllowed)
|
http.Error(w, http.StatusText(http.StatusNotImplemented), http.StatusNotImplemented)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user