Skip to content

Commit e9d8920

Browse files
kirkhansensnowman2
andauthored
Corteva fix binary support (#2)
Co-authored-by: snowman2 <[email protected]>
1 parent f2520c3 commit e9d8920

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

zappa/handler.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import base64
2-
import boto3
32
import collections
43
import datetime
54
import importlib
@@ -8,10 +7,11 @@
87
import logging
98
import os
109
import sys
11-
import traceback
1210
import tarfile
13-
11+
import traceback
1412
from builtins import str
13+
14+
import boto3
1515
from werkzeug.wrappers import Response
1616

1717
# This file may be copied into a project's root,
@@ -549,11 +549,9 @@ def handler(self, event, context):
549549
zappa_returndict.setdefault('statusDescription', response.status)
550550

551551
if response.data:
552-
if settings.BINARY_SUPPORT and \
553-
not response.mimetype.startswith("text/") \
554-
and response.mimetype != "application/json":
552+
if settings.BINARY_SUPPORT:
555553
zappa_returndict['body'] = base64.b64encode(response.data).decode('utf-8')
556-
zappa_returndict["isBase64Encoded"] = True
554+
zappa_returndict['isBase64Encoded'] = True
557555
else:
558556
zappa_returndict['body'] = response.get_data(as_text=True)
559557

0 commit comments

Comments
 (0)