flask-lambda
flask-lambda copied to clipboard
fix bug whene use sam local
when use 'sam local start-api' there is a error, so should set the default value first. there is a key error, like:
START RequestId: 23366b07-fe7f-4e1c-9c2b-5141843846da Version: $LATEST
'HTTP_X_FORWARDED_PROTO': KeyError
Traceback (most recent call last):
File "/var/task/flask_lambda.py", line 104, in __call__
make_environ(event),
File "/var/task/flask_lambda.py", line 70, in make_environ
environ['wsgi.url_scheme'] = environ['HTTP_X_FORWARDED_PROTO']
KeyError: 'HTTP_X_FORWARDED_PROTO'
Hi, I'd like to use flask-lambda with SAM as well and I'm hitting this issue too. Any ETA on merging this? Thanks!
Any ETA on merging this? Thanks!
No, the PR uses incorrect defaults and assumptions.
I will rewrite the the PR if you tell me what the correct defaults and assumptions are. My guess is.
SERVER_NAME = ''
and
HTTP_X_FORWARDED_PORT = 3000