@@ -29,6 +29,7 @@ assert.deepStrictEqual(val, check);
2929 [ 'maxHeaderListSize' , 2 ** 32 - 1 ] ,
3030 [ 'maxHeaderSize' , 0 ] ,
3131 [ 'maxHeaderSize' , 2 ** 32 - 1 ] ,
32+ [ 'customSettings' , { 9999 : 301 } ]
3233] . forEach ( ( i ) => {
3334 // Valid options should not throw.
3435 http2 . getPackedSettings ( { [ i [ 0 ] ] : i [ 1 ] } ) ;
@@ -93,6 +94,8 @@ http2.getPackedSettings({ enablePush: false });
9394 0x00 , 0x05 , 0x00 , 0x00 , 0x4e , 0x20 ,
9495 0x00 , 0x06 , 0x00 , 0x00 , 0x00 , 0x64 ,
9596 0x00 , 0x08 , 0x00 , 0x00 , 0x00 , 0x00 ,
97+ 0x00 , 0x08 , 0x00 , 0x00 , 0x00 , 0x00 ,
98+ 0x27 , 0x0F , 0x00 , 0x00 , 0x01 , 0x2d
9699 ] ) ;
97100
98101 const packed = http2 . getPackedSettings ( {
@@ -104,9 +107,10 @@ http2.getPackedSettings({ enablePush: false });
104107 maxHeaderSize : 100 ,
105108 enablePush : true ,
106109 enableConnectProtocol : false ,
107- foo : 'ignored'
110+ foo : 'ignored' ,
111+ customSettings : { 9999 : 301 }
108112 } ) ;
109- assert . strictEqual ( packed . length , 42 ) ;
113+ assert . strictEqual ( packed . length , 48 ) ;
110114 assert . deepStrictEqual ( packed , check ) ;
111115}
112116
@@ -124,7 +128,8 @@ http2.getPackedSettings({ enablePush: false });
124128 0x00 , 0x04 , 0x00 , 0x00 , 0x00 , 0x64 ,
125129 0x00 , 0x06 , 0x00 , 0x00 , 0x00 , 0x64 ,
126130 0x00 , 0x02 , 0x00 , 0x00 , 0x00 , 0x01 ,
127- 0x00 , 0x08 , 0x00 , 0x00 , 0x00 , 0x00 ] ) ;
131+ 0x00 , 0x08 , 0x00 , 0x00 , 0x00 , 0x00 ,
132+ 0x27 , 0x0F , 0x00 , 0x00 , 0x01 , 0x2d ] ) ;
128133
129134 [ 1 , true , '' , [ ] , { } , NaN ] . forEach ( ( input ) => {
130135 assert . throws ( ( ) => {
@@ -157,6 +162,7 @@ http2.getPackedSettings({ enablePush: false });
157162 assert . strictEqual ( settings . maxHeaderSize , 100 ) ;
158163 assert . strictEqual ( settings . enablePush , true ) ;
159164 assert . strictEqual ( settings . enableConnectProtocol , false ) ;
165+ assert . deepStrictEqual ( settings . customSettings , { 9999 : 301 } ) ;
160166}
161167
162168{
0 commit comments