Fix issue in message conversion
This change ensures that when the Accept and the Producible media types are equally specific, we use the one from the Accept header, which may for example carry a different charset.
This commit is contained in:
@@ -196,7 +196,7 @@ public abstract class AbstractMessageConverterMethodProcessor extends AbstractMe
|
||||
*/
|
||||
private MediaType getMostSpecificMediaType(MediaType acceptType, MediaType produceType) {
|
||||
produceType = produceType.copyQualityValue(acceptType);
|
||||
return MediaType.SPECIFICITY_COMPARATOR.compare(acceptType, produceType) < 0 ? acceptType : produceType;
|
||||
return MediaType.SPECIFICITY_COMPARATOR.compare(acceptType, produceType) <= 0 ? acceptType : produceType;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user