flask-lambda icon indicating copy to clipboard operation
flask-lambda copied to clipboard

fix bug whene use sam local

Open legenove opened this issue 8 years ago • 3 comments

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'

legenove avatar Jan 20 '18 05:01 legenove

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!

StefanSmith avatar Mar 18 '18 15:03 StefanSmith

Any ETA on merging this? Thanks!

No, the PR uses incorrect defaults and assumptions.

sivel avatar Mar 20 '18 19:03 sivel

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

frob avatar Jun 14 '18 22:06 frob