mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
@types/cookie - Add 'none' as a valid value for sameSite of the CookieSerializeOptions (#35570)
* @types/cookie - Add 'none' as a valid value for sameSite of the CookieSerializeOptions * @types/cookie - Add documentation for 'none' SameSite option
This commit is contained in:
parent
ebf0e7e257
commit
64d5f9c5f7
@ -5,6 +5,8 @@ function test_serialize(): void {
|
||||
|
||||
retVal = cookie.serialize('foo', 'bar');
|
||||
retVal = cookie.serialize('foo', 'bar', { httpOnly: true });
|
||||
retVal = cookie.serialize('foo', 'bar', { sameSite: 'none' });
|
||||
retVal = cookie.serialize('foo', 'bar', { sameSite: 'lax' });
|
||||
}
|
||||
|
||||
function test_parse(): void {
|
||||
@ -22,7 +24,8 @@ function test_options(): void {
|
||||
maxAge: 200,
|
||||
domain: 'example.com',
|
||||
secure: false,
|
||||
httpOnly: false
|
||||
httpOnly: false,
|
||||
sameSite: 'strict'
|
||||
};
|
||||
|
||||
const parseOptios: cookie.CookieParseOptions = {
|
||||
|
||||
4
types/cookie/index.d.ts
vendored
4
types/cookie/index.d.ts
vendored
@ -71,8 +71,10 @@ export interface CookieSerializeOptions {
|
||||
* enforcement.
|
||||
* - `'strict'` will set the `SameSite` attribute to Strict for strict same
|
||||
* site enforcement.
|
||||
* - `'none'` will set the SameSite attribute to None for an explicit
|
||||
* cross-site cookie.
|
||||
*/
|
||||
sameSite?: boolean | 'lax' | 'strict';
|
||||
sameSite?: boolean | 'lax' | 'strict' | 'none';
|
||||
/**
|
||||
* Specifies the boolean value for the `Secure` `Set-Cookie` attribute. When
|
||||
* truthy, the `Secure` attribute is set, otherwise it is not. By default,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user