dougmoscrop / serverless-http

Use your existing middleware framework (e.g. Express, Koa) in AWS Lambda 🎉
Other
1.72k stars 165 forks source link

Normalization of Query Params Between AWS Elastic Load Balancer and API Gateway #190

Closed jheising closed 3 years ago

jheising commented 3 years ago

When using AWS Elastic Load Balancer with Target Groups that point to Lambda functions, the event payload slightly differs from API Gateway in that API Gateway appears to automatically decode URL query parameters, whereas AWS ELB does not automatically decode URL query parameters.

We fix this by checking if requestContext.elb exists, and if so, we decode the URL query parameters to normalize it the same way that API Gateway does.