Skip to content

Commit e1b65a3

Browse files
committed
Update cookie.ts
1 parent 4eb101d commit e1b65a3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/utils/cookie.ts

+5
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export type CookieOptions = {
2424
signingSecret?: string
2525
sameSite?: 'Strict' | 'Lax' | 'None' | 'strict' | 'lax' | 'none'
2626
partitioned?: boolean
27+
priority?: 'Low' | 'Medium' | 'High'
2728
prefix?: CookiePrefixOptions
2829
} & PartitionedCookieConstraint
2930
export type CookiePrefixOptions = 'host' | 'secure'
@@ -204,6 +205,10 @@ const _serialize = (name: string, value: string, opt: CookieOptions = {}): strin
204205
cookie += `; SameSite=${opt.sameSite.charAt(0).toUpperCase() + opt.sameSite.slice(1)}`
205206
}
206207

208+
if (opt.priority) {
209+
cookie += `; Priority=${opt.priority}`
210+
}
211+
207212
if (opt.partitioned) {
208213
// FIXME: replace link to RFC
209214
// https://www.ietf.org/archive/id/draft-cutler-httpbis-partitioned-cookies-01.html#section-2.3

0 commit comments

Comments
 (0)