Skip to content

Commit

Permalink
fix: Handle multiple cookies with the same name in the same way API G…
Browse files Browse the repository at this point in the history
…ateway does.
  • Loading branch information
roberttaylor426 committed Jun 28, 2021
1 parent 3fb5b69 commit bcddae5
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,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 bcddae5

Please sign in to comment.