flask-lambda
flask-lambda copied to clipboard
support for Application ELB target
While calling from application ELB, always getting 502 gateway error
Same here with a VPC endpoint for API gateway. The error internally appears to be because headers flask-lambda is expecting are not set by the upstream:
[ERROR] KeyError: 'HTTP_X_FORWARDED_PORT'
Traceback (most recent call last):
File "/opt/package/flask_lambda.py", line 102, in __call__
make_environ(event),
File "/opt/package/flask_lambda.py", line 58, in make_environ
environ['HOST'] = '%(HTTP_HOST)s:%(HTTP_X_FORWARDED_PORT)s' % environ
Yes, @sidoh , having the same issue when deploying the lambda within a VPC.