Skip to content

Commit

Permalink
fix: bug when empty event headers (CodeGenieApp#462) (CodeGenieApp#463)
Browse files Browse the repository at this point in the history
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 CodeGenieApp#462
  • Loading branch information
codpot committed Oct 13, 2021
1 parent 196d91c commit 2b66164
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/event-sources/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function getRequestValuesFromEvent ({

if (event.multiValueHeaders) {
headers = getCommaDelimitedHeaders({ headersMap: event.multiValueHeaders, lowerCaseKey: true })
} else {
} else if (event.headers) {
headers = event.headers
}

Expand Down

0 comments on commit 2b66164

Please sign in to comment.