|
|
|
|
@ -13,7 +13,10 @@ import (
@@ -13,7 +13,10 @@ import (
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
var ( |
|
|
|
|
// ErrMethodMismatch is returned when the error in the request does not match
|
|
|
|
|
// the method defined against the route.
|
|
|
|
|
ErrMethodMismatch = errors.New("method is not allowed") |
|
|
|
|
// ErrNotFound is returned when no route match is found.
|
|
|
|
|
ErrNotFound = errors.New("no matching route was found") |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
@ -95,9 +98,9 @@ func (r *Router) Match(req *http.Request, match *RouteMatch) bool {
@@ -95,9 +98,9 @@ func (r *Router) Match(req *http.Request, match *RouteMatch) bool {
|
|
|
|
|
if r.MethodNotAllowedHandler != nil { |
|
|
|
|
match.Handler = r.MethodNotAllowedHandler |
|
|
|
|
return true |
|
|
|
|
} else { |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Closest match for a router (includes sub-routers)
|
|
|
|
|
|