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

fix: default application/json charset to utf-8 #1305

merged 4 commits into from Mar 3, 2021


Copy link

@chingor13 chingor13 commented Mar 2, 2021

Fixes #1102

@chingor13 chingor13 requested a review from as a code owner Mar 2, 2021
@google-cla google-cla bot added the cla: yes label Mar 2, 2021
// fallback to well-known charsets
if (mediaType.getType().equals("application") && mediaType.getSubType().equals("json")) {
// - JSON must be encoded with UTF-8
return StandardCharsets.UTF_8;
Copy link
Collaborator Author

@chingor13 chingor13 Mar 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fallback code can be refactored if we want to add more defaults.

Copy link

@codecov codecov bot commented Mar 2, 2021

Codecov Report

Merging #1305 (bc8c228) into master (1db338b) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@      Coverage Diff       @@
##   master   #1305   +/-   ##

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1db338b...9505eae. Read the comment docs.

@chingor13 chingor13 requested a review from elharo Mar 3, 2021
elharo approved these changes Mar 3, 2021
@chingor13 chingor13 added the automerge label Mar 3, 2021
@gcf-merge-on-green gcf-merge-on-green bot merged commit c4dfb48 into master Mar 3, 2021
13 checks passed
@gcf-merge-on-green gcf-merge-on-green bot deleted the json-charsets branch Mar 3, 2021
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge label Mar 3, 2021
gcf-merge-on-green bot pushed a commit that referenced this issue Mar 15, 2021
🤖 I have created a release \*beep\* \*boop\*
### [1.39.1]( (2021-03-15)

### Bug Fixes

* default application/json charset to utf-8 ([#1305]( ([c4dfb48](, closes [#1102](
* when disconnecting, close the underlying connection before the response InputStream ([#1315]( ([f84ed59](, closes [#1303](

### Documentation

* 19.0.0 libraries-bom ([#1312]( ([62be21b](
* update version ([#1296]( ([f17755c](

### Dependencies

* update dependency com.fasterxml.jackson.core:jackson-core to v2.12.2 ([#1309]( ([aa7d703](
* update dependency to v3.15.3 ([#1301]( ([1db338b](
* update dependency to v3.15.6 ([#1310]( ([9cb50e4](

This PR was generated with [Release Please]( See [documentation](
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
cla: yes
None yet

Successfully merging this pull request may close these issues.

2 participants