Skip to content
Myr

Merge pull request #5673 from jjmaldonis/master

Before adoption: this commit came in with the history the project adopted, so no landing records it.

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

authored by Ian Stapleton Cordasco · committed by GitHub · parents d0359c9, 5855dd7 · Browse files · 1 file+4 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−0 removed

  • other:+4 added−0 removed

1 file+4 added−0 removed

modified:requests/utils.py+4 added
501 unmodified lines
502503 if 'text' in content_type:504 return 'ISO-8859-1'505506 if 'application/json' in content_type:507 # Assume UTF-8 based on RFC 4627: https://www.ietf.org/rfc/rfc4627.txt since the charset was unset508 return 'utf-8'509510511def stream_decode_response_unicode(iterator, r):512 """Stream decodes a iterator."""513514 if r.encoding is None:
478 unmodified lines