Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug whene use sam local #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

legenove
Copy link

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'

@StefanSmith
Copy link

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!

@sivel
Copy link
Owner

sivel commented Mar 20, 2018

Any ETA on merging this? Thanks!

No, the PR uses incorrect defaults and assumptions.

@frob
Copy link

frob commented Jun 14, 2018

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

ollytheninja pushed a commit to ollytheninja/flask-lambda that referenced this pull request Oct 30, 2022
remove import compatibility with older python versions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants