serverless-express
serverless-express copied to clipboard
[Bug] Request headers from APIGWv2 Event can not be stringified
Having code like this:
const headers = JSON.stringify(req.headers);
gives an empty array, even if the incoming event had headers set correctly.
I think I found the underlying problem and opened a PR for that, see https://github.com/vendia/serverless-express/pull/386
+1 hit this same issue and can confirm @hffmnn 's fix works. Would love to see this get merged.
Can also confirm that the fix works.
And it is correct for v2 payload: https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
Merged. Sorry for the delay. And thanks again @hffmnn