Merge branch '5.3.x'

This commit is contained in:
Brian Clozel 2022-04-04 18:37:16 +02:00
commit 1776f08bfe
1 changed files with 3 additions and 3 deletions

View File

@ -243,12 +243,12 @@ public abstract class AbstractMessageConverterMethodProcessor extends AbstractMe
} }
} }
if (mediaTypesToUse.isEmpty()) { if (mediaTypesToUse.isEmpty()) {
if (body != null) {
throw new HttpMediaTypeNotAcceptableException(producibleTypes);
}
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {
logger.debug("No match for " + acceptableTypes + ", supported: " + producibleTypes); logger.debug("No match for " + acceptableTypes + ", supported: " + producibleTypes);
} }
if (body != null) {
throw new HttpMediaTypeNotAcceptableException(producibleTypes);
}
return; return;
} }