There is a bug/missing functionality in the library currently when trying to set headers on the response when using an ALB Lambda trigger with multiValueHeaders.
The names of the fields used for headers differ depending on whether you enable multi-value headers for the target group. You must use multiValueHeaders if you have enabled multi-value headers and headers otherwise.
The current implementation will return single value headers in the headers key which means if multiValueHeaders are enabled those headers go missing.
This PR aims to resolve the above issue and clean up the format function so that it can handle response formats for HTTP apis (V1 and V2) as well as ALB style responses.
There is a bug/missing functionality in the library currently when trying to set headers on the response when using an ALB Lambda trigger with multiValueHeaders.
In the case of an ALB event
The current implementation will return single value headers in the
headers
key which means if multiValueHeaders are enabled those headers go missing.This PR aims to resolve the above issue and clean up the format function so that it can handle response formats for HTTP apis (V1 and V2) as well as ALB style responses.