File tree 2 files changed +8
-3
lines changed
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -132,8 +132,13 @@ def process_body(self, body_wrapper):
132
132
body = body_wrapper .get ('body' )
133
133
transfer_encoding = 'json'
134
134
except Exception as e :
135
- body = base64 .b64encode (body_wrapper ['body' ].encode ("utf-8" ))
136
- return str (encodedBytes , "utf-8" ), 'json'
135
+ body = base64 .b64encode (str (body_wrapper ['body' ]).encode ("utf-8" ))
136
+ if isinstance (body , str ):
137
+ return str (body ).encode ("utf-8" ), 'base64'
138
+ elif isinstance (body , (bytes , bytearray )):
139
+ return str (body , "utf-8" ), 'base64'
140
+ else :
141
+ return str (body ), 'base64'
137
142
return body , transfer_encoding
138
143
139
144
def before (self , event , context ):
Original file line number Diff line number Diff line change 28
28
# Versions should comply with PEP440. For a discussion on single-sourcing
29
29
# the version across setup.py and the project code, see
30
30
# https://packaging.python.org/en/latest/single_source_version.html
31
- version = '1.0.5 ' ,
31
+ version = '1.0.6 ' ,
32
32
33
33
description = 'Moesif Middleware to automatically log API calls from AWS Lambda functions' ,
34
34
long_description = long_description ,
You can’t perform that action at this time.
0 commit comments