Fix #271: Return 405 instead of 404 when request method doesn't match the route
This commit is contained in:
committed by
Kamil Kisiel
parent
ac112f7d75
commit
a659b61323
@@ -121,12 +121,7 @@ func TestRouteMatchers(t *testing.T) {
|
||||
var routeMatch RouteMatch
|
||||
matched := router.Match(request, &routeMatch)
|
||||
if matched != shouldMatch {
|
||||
// Need better messages. :)
|
||||
if matched {
|
||||
t.Errorf("Should match.")
|
||||
} else {
|
||||
t.Errorf("Should not match.")
|
||||
}
|
||||
t.Errorf("Expected: %v\nGot: %v\nRequest: %v %v", shouldMatch, matched, request.Method, url)
|
||||
}
|
||||
|
||||
if matched {
|
||||
@@ -188,7 +183,6 @@ func TestRouteMatchers(t *testing.T) {
|
||||
match(true)
|
||||
|
||||
// 2nd route --------------------------------------------------------------
|
||||
|
||||
// Everything match.
|
||||
reset2()
|
||||
match(true)
|
||||
|
||||
Reference in New Issue
Block a user