The logic in MimeType.includes and MimeType.isCompatibleWith appears to have a bug, in that they assume there will only be one + character in the media type string.
For example, application/*+json does not include a media type of the form application/x.y+z+json.
My understanding from the RFC is that multiple + characters are allowed, and everything following the last + defines the syntax suffix.
The code in MimeType is using
to locate the syntax suffix. My belief is that it should be using
Steps to reproduce:
Use RestTemplate to make an HTTP request with a custom Content-Type header of application/x.y+z+json. An error is thrown:
Proposed change: https://github.com/spring-projects/spring-framework/pull/1481