mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
Add sameSite property to Cookie interface (#40422)
This commit is contained in:
committed by
Pranav Senthilnathan
parent
85eacf4d39
commit
ca5bcb9f1c
1
types/set-cookie-parser/index.d.ts
vendored
1
types/set-cookie-parser/index.d.ts
vendored
@@ -29,6 +29,7 @@ declare module "set-cookie-parser" {
|
||||
domain?: string;
|
||||
secure?: boolean;
|
||||
httpOnly?: boolean;
|
||||
sameSite?: string;
|
||||
}
|
||||
|
||||
interface CookieMap {
|
||||
|
||||
@@ -17,7 +17,7 @@ assert.equal(cookies[0].name, "foo");
|
||||
assert.equal(cookies[0].value, "bar");
|
||||
|
||||
// Optional properties included test
|
||||
var optionalIncluded = "foo=bar; Max-Age=1000; Domain=.example.com; Path=/; Expires=Tue, 01 Jul 2025 10:01:11 GMT; HttpOnly; Secure";
|
||||
var optionalIncluded = "foo=bar; Max-Age=1000; Domain=.example.com; Path=/; Expires=Tue, 01 Jul 2025 10:01:11 GMT; HttpOnly; Secure; SameSite=Strict";
|
||||
cookies = setCookie(optionalIncluded);
|
||||
assert.equal(cookies.length, 1);
|
||||
assert.equal(cookies[0].name, "foo");
|
||||
@@ -28,6 +28,7 @@ assert.deepEqual(cookies[0].expires, new Date('Tue Jul 01 2025 06:01:11 GMT-0400
|
||||
assert.equal(cookies[0].maxAge, 1000);
|
||||
assert.equal(cookies[0].httpOnly, true);
|
||||
assert.equal(cookies[0].secure, true);
|
||||
assert.equal(cookies[0].sameSite, "Strict");
|
||||
|
||||
// Array of strings test
|
||||
var arrayOfCookies = ["bam=baz", "foo=bar"];
|
||||
|
||||
Reference in New Issue
Block a user