Skip to content

Commit 8099166

Browse files
committed
Bugfix: use apparent_encoding if encoding is set to None
1 parent 949056d commit 8099166

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

intercom/request.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ def send_request_to_path(cls, method, url, auth, params=None):
4343
def parse_body(cls, resp):
4444
try:
4545
# use supplied encoding to decode the response content
46-
decoded_body = resp.content.decode(resp.encoding)
46+
decoded_body = resp.content.decode(
47+
resp.encoding or resp.apparent_encoding
48+
)
4749
if not decoded_body: # return early for empty responses (issue-72)
4850
return
4951
body = json.loads(decoded_body)

0 commit comments

Comments
 (0)