Skip to content

Commit 2b66164

Browse files
authored
fix: bug when empty event headers (#462) (#463)
Due to in several express.js libraries treats req.headers as NonNullable Object, when event headers is null causing bugs. When incoming headers from API Gateway is null, it should transform to {}. Fix #462
1 parent 196d91c commit 2b66164

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/event-sources/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function getRequestValuesFromEvent ({
3232

3333
if (event.multiValueHeaders) {
3434
headers = getCommaDelimitedHeaders({ headersMap: event.multiValueHeaders, lowerCaseKey: true })
35-
} else {
35+
} else if (event.headers) {
3636
headers = event.headers
3737
}
3838

0 commit comments

Comments
 (0)