SPR-4927 - Return 405 instead of 404 when HTTP method is not supported
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user