Open kdeloach opened 3 years ago
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? Its a bit annoying to have to craft some dummy headers just to make it work.
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 aws-lambda-go-api-proxy
sets the default headers, they are ignored by the ALB. Had the same issues and setting the multi-value header flag to true
resolved issues for me
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
aws-lambda-go-api-proxy
sets the default headers, they are ignored by the ALB. Had the same issues and setting the multi-value header flag totrue
resolved issues for me
Works for me! tks!
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: