Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion zappa/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,10 @@ def handler(self, event, context):
zappa_returndict['body'] = base64.b64encode(response.data).decode('utf-8')
zappa_returndict["isBase64Encoded"] = True
else:
zappa_returndict['body'] = response.get_data(as_text=True)
try:
zappa_returndict['body'] = response.get_data(as_text=True)
except UnicodeDecodeError:
zappa_returndict["body"] = response.data

zappa_returndict['statusCode'] = response.status_code
if 'headers' in event:
Expand Down