mirror of
https://github.com/honojs/hono.git
synced 2024-11-24 19:26:56 +01:00
fix(aws-lambda): set cookies with comma is bugged (#3084)
* fix(aws-lambda): setting cookies with comma is bugged * style: apply lint & format fixes
This commit is contained in:
parent
75c314c279
commit
1e3e58bb45
@ -258,7 +258,12 @@ abstract class EventProcessor<E extends LambdaEvent> {
|
||||
|
||||
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')
|
||||
|
Loading…
Reference in New Issue
Block a user