MediaType parameters in the "consumes" condition of @RequestMapping
are not considered for matching
#28024
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
This issue was opened based on the discussion in #27999.
Given the following controller:
A request that provides a request body with the content type
application/hal+json;profile="my-resource-v2"
is being routed topostVersion1
but should be routed topostVersion2
.Even worse, if the
consumes
media type only differs in media type parameters and the handler methods can't be ranked byproduces
anAmbiguous handler methods mapped for ...
error will be thrown leading to a 500er.Example
Controller:
Request:
Response:
Looking into the code, it seems like
consumes
andproduces
are treated differently inProducesRequestCondition
andConsumesRequestCondition
when it comes to media type parameters.Affects: 5.3.15
The text was updated successfully, but these errors were encountered: