-
Notifications
You must be signed in to change notification settings - Fork 202
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
502 Bad Gateway error because Headers field is nil #79
Comments
Can confirm this issue with Application Load Balancers too, reverting #73 results in a properly working HTTP response. Only noticed this issue after updating from v0.8.0 to v0.12.0 |
Ran into this issue myself with only Lambda functions (not using HTTP API or ALB), and additionally HTTP API Payload Format 2.0 has removed multi-value headers and just uses headers. I don't think there should be a non-pointer field that is not initialized. Is there a plan to fix? |
I think I've faced this issue and realized that the Headers field always nil. (https://github.com/awslabs/aws-lambda-go-api-proxy/blob/master/core/response.go#L108) In my case, API Gateway failed with internal error until headers was populated with content type at least. |
Are there any plans to fix this? |
The fix is in the AWS target group. By default, ALB requires a content-type header and by default it ignores multi-value headers (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/lambda-functions.html#enable-multi-value-headers). Even though the |
Works for me! tks! |
You are a god, thank you! |
I get 502 Bad Gateway response from AWS LB using the exact source code from the README with the latest release v0.8.1.
This is due to a recent change in #73 which results in
Headers
being set tonil
on the proxy response. You can work around this by addingHeaders
to the proxied response.Lambda output and HTTP response using the code from the README:
My workaround:
Lambda output and HTTP response with this workaround:
The text was updated successfully, but these errors were encountered: