1
0
mirror of synced 2026-02-08 15:00:08 -05:00

Compare commits

...

3 Commits

Author SHA1 Message Date
Siddharth Suresh
5a546d4c72 Create proud-experts-collect.md 2025-03-03 18:22:07 +05:30
Siddharth Suresh
5366222c34 fixes 2025-03-03 18:19:37 +05:30
Siddharth Suresh
0a7e7a6e62 fix: null cookies being set 2025-03-03 14:23:41 +05:30
2 changed files with 12 additions and 5 deletions

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/auth": patch
---
fix: TODO: Optimise cookie setting flow

View File

@@ -465,10 +465,12 @@ export class SessionContextClass implements SessionContext {
return
}
const cookieHeaders = this._headers.get("set-cookie")
if (response instanceof Response) {
response.headers.append("Set-Cookie", cookieHeaders!)
} else {
append(response, "Set-Cookie", splitCookiesString(cookieHeaders!))
if (cookieHeaders) {
if (response instanceof Response) {
response.headers.append("Set-Cookie", cookieHeaders)
} else {
append(response, "Set-Cookie", splitCookiesString(cookieHeaders))
}
}
const headers = this._headers.entries()
@@ -1281,7 +1283,7 @@ export function append(res: ServerResponse, field: string, val: string | string[
: [prev, val]
}
value = Array.isArray(value) ? value.map(String) : String(value)
value = Array.isArray(value) ? value.filter(Boolean).map(String) : String(value)
res.setHeader(field, value)
return res
}