Skip to content
Open
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
7 changes: 4 additions & 3 deletions flask_lambda.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,6 +15,7 @@
# under the License.

import sys
import json

try:
from urllib import urlencode
Expand DownExpand Up@@ -69,7 +70,7 @@ def make_environ(event):
)

environ['wsgi.url_scheme'] = environ['HTTP_X_FORWARDED_PROTO']
environ['wsgi.input'] = StringIO(event['body'] or '')
environ['wsgi.input'] = StringIO(json.dumps(event['body']) or '')
environ['wsgi.version'] = (1, 0)
environ['wsgi.errors'] = sys.stderr
environ['wsgi.multithread'] = False
Expand DownExpand Up@@ -109,5 +110,5 @@ def __call__(self, event, context):
return {
'statusCode': response.status,
'headers': response.response_headers,
'body': body
}
'body': json.loads(body)
}