Closed
Description
Affects: 5.1.10
Spring RestController offers a nice function, one could filter requests by methods. E.g.:
@RequestMapping(value = "/some-pattern", method = {RequestMethod.GET, RequestMethod.HEAD})
public Mono<Void> handler(...)
If a request matches the path pattern but does not match the method pattern spring-web automatically generates a response 405 Method Not Allowed
which is perfectly fine.
But RFC 7231 Explicitly requires servers to include the Allow header (https://tools.ietf.org/html/rfc7231#page-59):
The origin server MUST generate an Allow header field in a 405 response containing a list of the target resource's currently supported methods.
It request method filters must automatically insert an Allow header with a list of allowed methods into a response.