elliot barlas opened SPR-9603 and commented
The handleNoMatch method of the RequestMappingInfoHandlerMapping class incorrectly throws HttpRequestMethodNotSupportedException if:
- A request handler method exists that matches the path and methods but not produce/consume expression
- Another request handler method exists that matches the path but not the method
In this case, the handleNoMatch method finds the request handler method that matches the path but not the method, resulting in a HttpRequestMethodNotSupportedException (line 135).
Example:
Request sent for "/users" with "Accept: application/xml"
@RequestMapping(value = "/users", method = GET, produces = "application/json")
public void foo() {...}
@RequestMapping(value = "/users", method = PUT)
public void bar() {...}
Expected exception HttpMediaTypeNotAcceptableException, observed exception HttpRequestMethodNotSupportedException.
Affects: 3.1 GA
Issue Links:
Referenced from: commits 473de08, f78bef9
elliot barlas opened SPR-9603 and commented
The handleNoMatch method of the RequestMappingInfoHandlerMapping class incorrectly throws HttpRequestMethodNotSupportedException if:
In this case, the handleNoMatch method finds the request handler method that matches the path but not the method, resulting in a HttpRequestMethodNotSupportedException (line 135).
Example:
Request sent for "/users" with "Accept: application/xml"
Expected exception HttpMediaTypeNotAcceptableException, observed exception HttpRequestMethodNotSupportedException.
Affects: 3.1 GA
Issue Links:
Referenced from: commits 473de08, f78bef9