-
Notifications
You must be signed in to change notification settings - Fork 83
Description
Suppose an HTTP client submits a request to the server with header "Accept: /" or even no accept header at all. Clearly, a json response is acceptable here. In both cases jersey will set the MediaType of the request to "/" (in the absense of any @produces annotation on the resource method).
The code eventually comes to jackson-jaxrs-json-provider-2.9.6-sources.jar:com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider:hasMatchingMediaType which returns false for MediaType.WILDCARD_TYPE.
I think that in this case it should return true. And by extension it should return true for application/* media types.
In other words, mediaType = MediaType.WILDCARD_TYPE should be handled in the same way as mediaType = null.
jackson-jaxrs-providers/json/src/main/java/com/fasterxml/jackson/jaxrs/json/JacksonJsonProvider.java
Line 168 in 9958c03
protected boolean hasMatchingMediaType(MediaType mediaType) |