StringHttpMessageConverter addDefaultHeaders() should check media type for wildcard before setting it into headers #24283
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
I have just started to fail after this change 9b30d46.
My content type candidate is like this one:
So,
MediaType.ALL
is really compatible withMediaType.APPLICATION_JSON
, but it is wrong value for theContent-Type
header:Any clues what to use instead of
MediaType.ALL
when noAccept
header in the request?Or maybe this fix should be improved to skip
MediaType.ALL
as it is done in the super class:Note that
AbstractMessageConverterMethodProcessor
is not used in Spring Integration.There logic in the
HttpRequestHandlingMessagingGateway
is like this: https://github.com/spring-projects/spring-integration/blob/master/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingMessagingGateway.java#L171So, instead of falling back to the
MediaType.APPLICATION_OCTET_STREAM
we try to rely on the Content-Type populated by the converted which fits to thepayload
we would like to return into the response.Originally based on discussion.
The text was updated successfully, but these errors were encountered: