Skip to content
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

MappingJackson2HttpMessageConverter might be too specific in its Charset support #25322

Closed
smaldini opened this issue Jun 26, 2020 · 3 comments
Closed
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: backported An issue that has been backported to maintenance branches status: duplicate A duplicate of another issue status: feedback-provided Feedback has been provided type: regression A bug that is also a regression
Milestone

Comments

@smaldini
Copy link
Contributor

smaldini commented Jun 26, 2020

With this eb0aae0#diff-ea14ba194c2adb7f8aa7f97a2ca5bcc7, spring web Jackson2 Converter introduced an enum set limiting UTF options. In a testing scenario we use "US-ASCII" which was working until now. Since 5.2.7, the controller will rejects requests, failing to decode.
Is that the intended behavior or should ENCODINGS map include US-ASCII as well ?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jun 26, 2020
@poutsma poutsma self-assigned this Jun 29, 2020
@poutsma poutsma added for: backport-to-5.1.x Marks an issue as a candidate for backport to 5.1.x in: web Issues in web modules (web, webmvc, webflux, websocket) and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jun 30, 2020
@spring-projects-issues spring-projects-issues added status: backported An issue that has been backported to maintenance branches and removed for: backport-to-5.1.x Marks an issue as a candidate for backport to 5.1.x labels Jun 30, 2020
@poutsma poutsma added this to the 5.2.8 milestone Jun 30, 2020
@poutsma
Copy link
Contributor

poutsma commented Jun 30, 2020

Hey @smaldini, I think this has already been fixed as part of #25247. Can you please try a recent 5.2.8 snapshot and see if that works as expected?

Though this issue is about decoding ASCII, it did remind me that we should also support ASCII for encoding as well, because it is essentially the same as UTF-8. So I will fix that.

poutsma added a commit that referenced this issue Jun 30, 2020
This commit introduces support for writing JSON with an US-ASCII
character encoding in the Jackson encoder and message converter,
treating it like UTF-8.

See gh-25322
poutsma added a commit that referenced this issue Jun 30, 2020
This commit introduces support for writing JSON with an US-ASCII
character encoding in the Jackson encoder and message converter,
treating it like UTF-8.

See gh-25322

(cherry picked from commit 79c339b)
@poutsma poutsma added the status: waiting-for-feedback We need additional information before we can continue label Jun 30, 2020
@smaldini
Copy link
Contributor Author

@poutsma good job ! We have confirmed it fixed it sorry for the noise :) Talk soon !

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jun 30, 2020
@poutsma
Copy link
Contributor

poutsma commented Jul 1, 2020

Closing as duplicate of #25247.

@poutsma poutsma closed this as completed Jul 1, 2020
@poutsma poutsma added the status: duplicate A duplicate of another issue label Jul 1, 2020
@jhoeller jhoeller added the type: regression A bug that is also a regression label Jul 6, 2020
FelixFly pushed a commit to FelixFly/spring-framework that referenced this issue Aug 16, 2020
This commit introduces support for writing JSON with an US-ASCII
character encoding in the Jackson encoder and message converter,
treating it like UTF-8.

See spring-projectsgh-25322
zx20110729 pushed a commit to zx20110729/spring-framework that referenced this issue Feb 18, 2022
This commit introduces support for writing JSON with an US-ASCII
character encoding in the Jackson encoder and message converter,
treating it like UTF-8.

See spring-projectsgh-25322

(cherry picked from commit 79c339b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: backported An issue that has been backported to maintenance branches status: duplicate A duplicate of another issue status: feedback-provided Feedback has been provided type: regression A bug that is also a regression
Projects
None yet
Development

No branches or pull requests

4 participants