diff --git a/src/adapter/aws-lambda/handler.ts b/src/adapter/aws-lambda/handler.ts index 4a5cfdad..634545e4 100644 --- a/src/adapter/aws-lambda/handler.ts +++ b/src/adapter/aws-lambda/handler.ts @@ -258,7 +258,12 @@ abstract class EventProcessor { setCookies(event: E, res: Response, result: APIGatewayProxyResult) { if (res.headers.has('set-cookie')) { - const cookies = res.headers.get('set-cookie')?.split(', ') + const cookies = res.headers.getSetCookie + ? res.headers.getSetCookie() + : Array.from(res.headers.entries()) + .filter(([k]) => k === 'set-cookie') + .map(([, v]) => v) + if (Array.isArray(cookies)) { this.setCookiesToResult(event, result, cookies) res.headers.delete('set-cookie')