File tree 6 files changed +60
-2
lines changed
6 files changed +60
-2
lines changed Original file line number Diff line number Diff line change 1
1
unreleased
2
2
==========
3
3
4
+ * Add ` partitioned ` to ` cookie ` options
4
5
* Add ` priority ` to ` cookie ` options
5
6
* Fix handling errors from setting cookie
6
7
* Support any type in ` secret ` that ` crypto.createHmac ` supports
7
- * deps: cookie@0.5 .0
8
+ * deps: cookie@0.6 .0
8
9
- Fix ` expires ` option to reject invalid dates
9
10
- perf: improve default decode speed
10
11
- perf: remove slow string split in parse
Original file line number Diff line number Diff line change @@ -89,6 +89,18 @@ no maximum age is set.
89
89
** Note** If both ` expires ` and ` maxAge ` are set in the options, then the last one
90
90
defined in the object is what is used.
91
91
92
+ ##### cookie.partitioned
93
+
94
+ Specifies the ` boolean ` value for the [ ` Partitioned ` ` Set-Cookie ` ] ( rfc-cutler-httpbis-partitioned-cookies )
95
+ attribute. When truthy, the ` Partitioned ` attribute is set, otherwise it is not.
96
+ By default, the ` Partitioned ` attribute is not set.
97
+
98
+ ** Note** This is an attribute that has not yet been fully standardized, and may
99
+ change in the future. This also means many clients may ignore this attribute until
100
+ they understand it.
101
+
102
+ More information about can be found in [ the proposal] ( https://github.com/privacycg/CHIPS ) .
103
+
92
104
##### cookie.path
93
105
94
106
Specifies the value for the ` Path ` ` Set-Cookie ` . By default, this is set to ` '/' ` , which
@@ -1003,6 +1015,7 @@ On Windows, use the corresponding command;
1003
1015
[ MIT] ( LICENSE )
1004
1016
1005
1017
[ rfc-6265bis-03-4.1.2.7 ] : https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-4.1.2.7
1018
+ [ rfc-cutler-httpbis-partitioned-cookies ] : https://tools.ietf.org/html/draft-cutler-httpbis-partitioned-cookies/
1006
1019
[ rfc-west-cookie-priority-00-4.1 ] : https://tools.ietf.org/html/draft-west-cookie-priority-00#section-4.1
1007
1020
[ ci-image ] : https://badgen.net/github/checks/expressjs/session/master?label=ci
1008
1021
[ ci-url ] : https://github.com/expressjs/session/actions?query=workflow%3Aci
Original file line number Diff line number Diff line change 10
10
"repository" : " expressjs/session" ,
11
11
"license" : " MIT" ,
12
12
"dependencies" : {
13
- "cookie" : " 0.5 .0" ,
13
+ "cookie" : " 0.6 .0" ,
14
14
"cookie-signature" : " 1.0.7" ,
15
15
"debug" : " 2.6.9" ,
16
16
"depd" : " ~2.0.0" ,
Original file line number Diff line number Diff line change @@ -117,6 +117,7 @@ Cookie.prototype = {
117
117
get data ( ) {
118
118
return {
119
119
originalMaxAge : this . originalMaxAge ,
120
+ partitioned : this . partitioned ,
120
121
priority : this . priority
121
122
, expires : this . _expires
122
123
, secure : this . secure
Original file line number Diff line number Diff line change @@ -107,6 +107,14 @@ describe('new Cookie()', function () {
107
107
} )
108
108
} )
109
109
110
+ describe ( 'partitioned' , function ( ) {
111
+ it ( 'should set partitioned' , function ( ) {
112
+ var cookie = new Cookie ( { partitioned : true } )
113
+
114
+ assert . strictEqual ( cookie . partitioned , true )
115
+ } )
116
+ } )
117
+
110
118
describe ( 'path' , function ( ) {
111
119
it ( 'should set path' , function ( ) {
112
120
var cookie = new Cookie ( { path : '/foo' } )
Original file line number Diff line number Diff line change @@ -2233,6 +2233,41 @@ describe('session()', function(){
2233
2233
} )
2234
2234
} )
2235
2235
} )
2236
+
2237
+ describe ( '.partitioned' , function ( ) {
2238
+ describe ( 'by default' , function ( ) {
2239
+ it ( 'should not set partitioned attribute' , function ( done ) {
2240
+ var server = createServer ( )
2241
+
2242
+ request ( server )
2243
+ . get ( '/' )
2244
+ . expect ( shouldSetCookieWithoutAttribute ( 'connect.sid' , 'Partitioned' ) )
2245
+ . expect ( 200 , done )
2246
+ } )
2247
+ } )
2248
+
2249
+ describe ( 'when "false"' , function ( ) {
2250
+ it ( 'should not set partitioned attribute' , function ( done ) {
2251
+ var server = createServer ( { cookie : { partitioned : false } } )
2252
+
2253
+ request ( server )
2254
+ . get ( '/' )
2255
+ . expect ( shouldSetCookieWithoutAttribute ( 'connect.sid' , 'Partitioned' ) )
2256
+ . expect ( 200 , done )
2257
+ } )
2258
+ } )
2259
+
2260
+ describe ( 'when "true"' , function ( ) {
2261
+ it ( 'should set partitioned attribute' , function ( done ) {
2262
+ var server = createServer ( { cookie : { partitioned : true } } )
2263
+
2264
+ request ( server )
2265
+ . get ( '/' )
2266
+ . expect ( shouldSetCookieWithAttribute ( 'connect.sid' , 'Partitioned' ) )
2267
+ . expect ( 200 , done )
2268
+ } )
2269
+ } )
2270
+ } )
2236
2271
} )
2237
2272
} )
2238
2273
You can’t perform that action at this time.
0 commit comments