-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Closed
Closed
Copy link
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: enhancementA general enhancementA general enhancement
Milestone
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.
marx-freedom and KanyCTa
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: enhancementA general enhancementA general enhancement