Details
-
Type:
New Feature
-
Status: Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 5.1.3
-
Fix Version/s: 5.x Backlog
-
Labels:
-
Last commented by a User:true
Description
The request predicates were designed to return a boolean to match the request, so the WebFlux router engine always returns the same status code (404) when the predicate returns false.
The problem is that some predicates need custom responses, for example:
RequestPredicates.accept() should return 406 (Not Acceptable) RequestPredicates.contentType() should return 415 (Unsupported Media Type) RequestPredicates.GET() or POST() or any other method should return 405 (Method Not Allowed)
My suggestion is to redesign the RequestPredicate to be able to return customized responses to properly handle each HTTP status code.
Does it make sense?