Skip to content

Commit

Permalink
Merge pull request #1249 from roberttaylor426/master
Browse files Browse the repository at this point in the history
Handle multiple cookies with the same name in the same way API Gateway does.
  • Loading branch information
dherault committed Apr 13, 2022
2 parents 547ab27 + bcddae5 commit fa0de52
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -155,8 +155,13 @@ export default class LambdaProxyIntegrationEventV2 {
const requestTime = formatToClfTime(received)
const requestTimeEpoch = received

const cookies = Object.entries(this.#request.state).map(
([key, value]) => `${key}=${value}`,
const cookies = Object.entries(this.#request.state).flatMap(
([key, value]) => {
if (Array.isArray(value)) {
return value.map((v) => `${key}=${v}`)
}
return `${key}=${value}`
},
)

return {
Expand Down

0 comments on commit fa0de52

Please sign in to comment.