SPR-4927 - Return 405 instead of 404 when HTTP method is not supported

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@1142 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Arjen Poutsma
2009-05-11 13:32:28 +00:00
parent 0650a6d471
commit 3854aea64b
2 changed files with 52 additions and 0 deletions
@@ -446,6 +446,10 @@ public class AnnotationMethodHandlerAdapter extends WebContentGenerator implemen
if (match && mappingInfo.methods.length == 0 && mappingInfo.params.length == 0 &&
resolvedMethodName != null && !resolvedMethodName.equals(handlerMethod.getName())) {
match = false;
} else {
for (RequestMethod requestMethod : mappingInfo.methods) {
allowedMethods.add(requestMethod.toString());
}
}
}
if (match) {