New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Message conversion issue going from 2.3.0 to 2.3.1 #22080
Comments
Thanks for the report. Unfortunately, I can't tell what's going on from the information you have provided. I suspect that the If you would like us to spend some more time investigating, please spend some time providing a complete yet minimal sample that reproduces the problem. You can share it with us pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue. |
This isn't a reproducible sample, but I'm still hoping it might help. I debugged through the failing
protected boolean canRead(@Nullable MediaType mediaType) {
if (mediaType == null) {
return true;
}
for (MediaType supportedMediaType : getSupportedMediaTypes()) {
if (supportedMediaType.includes(mediaType)) {
return true;
}
}
return false;
}
I suspect this would fail for |
I'm not sure this would fail.
This test passes. |
I'm unsure how to demonstrate the issue in a sample application. I do have one more idea as to the cause (hopefully more fully thought out than my last one). File: private boolean checkEncoding(@Nullable MediaType mediaType) {
if (mediaType != null && mediaType.getCharset() != null) {
Charset charset = mediaType.getCharset();
return ENCODINGS.containsKey(charset.name());
}
return true;
}
This check fails for
Edit: The change appears to have been introduced with this commit. Edit: It looks like this issue may have been previously reported and a fix may be in progress. |
Can you override the Spring Framework version in your application and try the 5.2.8 Snapshots then? If it fixes the problem, we can mark this issue as a duplicate. If it doesn’t, we’ll need an application reproducing the bug to investigate. |
Built with a 5.2.8 snapshot and confirmed this issue is no longer present. Thanks for the help! |
Thanks for checking, this is really helping the team! |
Just to let you know. We experienced exactly the same problem with Spring Boot 2.2.8.RELEASE. So is this going to be backported to 2.2.x release also? |
@djoop69 Spring Boot 2.3.x and 2.2.x both use Spring Framework 5.2.x where the fix has been made. Both will update to Spring Framework 5.2.8 in their next maintenance releases. |
@wilkinsona Thanks, will see which is our best upgrade path. Either the next 2.2.x or the 2.3.x |
worked with 5.2.8 Release. |
Hello,
The project I'm working on is experiencing an interesting HTTP message conversion issue starting with Spring Boot 2.3.1 (the call in question works fine on 2.3.0 and older versions).
Stack trace:
POJO:
The response from the service looks something like this:
{"agentDirectoryUsername":"placeholder"}
Content-Type: application/json;charset=ISO-8859-1
(No idea why the charset is set to ISO-8859-1, but this was working fine on Spring Boot 2.3.0.)Any ideas what caused this going from 2.3.0 to 2.3.1 and how to address it? Thanks!
The text was updated successfully, but these errors were encountered: