Clean up content type in ContentNegotiatingViewResolver
This commit removes the quality value of the selected media type before setting it in the request attribute. Closes gh-26315
This commit is contained in:
@@ -344,6 +344,7 @@ public class ContentNegotiatingViewResolver extends WebApplicationObjectSupport
|
||||
if (StringUtils.hasText(candidateView.getContentType())) {
|
||||
MediaType candidateContentType = MediaType.parseMediaType(candidateView.getContentType());
|
||||
if (mediaType.isCompatibleWith(candidateContentType)) {
|
||||
mediaType = mediaType.removeQualityValue();
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Selected '" + mediaType + "' given " + requestedMediaTypes);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user