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

updated get_encoding_from_headers to return utf-8 if the content type is set to application/json #5673

Merged
merged 1 commit into from
Nov 29, 2020

Conversation

jjmaldonis
Copy link
Contributor

This PR fixes #5667 by adding a small bit of code to get_encoding_from_headers that returns utf-8 if the content type is set to application/json and charset is not set. This follows RFC 4627 (ctrl+f for shall be) which reads: "JSON text SHALL be encoded in Unicode. The default encoding is UTF-8."

…pe is set to application/json, following RFC 4627.

fixes psf#5667
@sigmavirus24 sigmavirus24 merged commit 589c454 into psf:master Nov 29, 2020
@jjmaldonis
Copy link
Contributor Author

Awesome, thanks for the fast responses here and for merging!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

r.text and r.json() return different results *in some cases*
4 participants