Skip to content

Commit fbe093d

Browse files
committed
for some reason intercom started to return another version of empty string
' '
1 parent 9275638 commit fbe093d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

intercom/request.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +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)
47-
if not decoded_body: # return early for empty responses (issue-72)
46+
if not resp.content or resp.content == ' ': # return early for empty responses (issue-72)
4847
return
48+
decoded_body = resp.content.decode(resp.encoding)
4949
body = json.loads(decoded_body)
5050
if body.get('type') == 'error.list':
5151
cls.raise_application_errors_on_failure(body, resp.status_code)

0 commit comments

Comments
 (0)