@@ -12,7 +12,6 @@ const {
12
12
FunctionPrototypeCall,
13
13
MathMin,
14
14
ObjectAssign,
15
- ObjectCreate,
16
15
ObjectKeys,
17
16
ObjectDefineProperty,
18
17
ObjectPrototypeHasOwnProperty,
@@ -1753,7 +1752,7 @@ class ClientHttp2Session extends Http2Session {
1753
1752
assertIsObject ( headers , 'headers' ) ;
1754
1753
assertIsObject ( options , 'options' ) ;
1755
1754
1756
- headers = ObjectAssign ( ObjectCreate ( null ) , headers ) ;
1755
+ headers = ObjectAssign ( { __proto__ : null } , headers ) ;
1757
1756
options = { ...options } ;
1758
1757
1759
1758
if ( headers [ HTTP2_HEADER_METHOD ] === undefined )
@@ -2252,7 +2251,7 @@ class Http2Stream extends Duplex {
2252
2251
throw new ERR_HTTP2_TRAILERS_NOT_READY ( ) ;
2253
2252
2254
2253
assertIsObject ( headers , 'headers' ) ;
2255
- headers = ObjectAssign ( ObjectCreate ( null ) , headers ) ;
2254
+ headers = ObjectAssign ( { __proto__ : null } , headers ) ;
2256
2255
2257
2256
debugStreamObj ( this , 'sending trailers' ) ;
2258
2257
@@ -2420,7 +2419,7 @@ function callStreamClose(stream) {
2420
2419
2421
2420
function processHeaders ( oldHeaders , options ) {
2422
2421
assertIsObject ( oldHeaders , 'headers' ) ;
2423
- const headers = ObjectCreate ( null ) ;
2422
+ const headers = { __proto__ : null } ;
2424
2423
2425
2424
if ( oldHeaders !== null && oldHeaders !== undefined ) {
2426
2425
// This loop is here for performance reason. Do not change.
@@ -2696,7 +2695,7 @@ class ServerHttp2Stream extends Http2Stream {
2696
2695
options . endStream = ! ! options . endStream ;
2697
2696
2698
2697
assertIsObject ( headers , 'headers' ) ;
2699
- headers = ObjectAssign ( ObjectCreate ( null ) , headers ) ;
2698
+ headers = ObjectAssign ( { __proto__ : null } , headers ) ;
2700
2699
2701
2700
if ( headers [ HTTP2_HEADER_METHOD ] === undefined )
2702
2701
headers [ HTTP2_HEADER_METHOD ] = HTTP2_METHOD_GET ;
@@ -2931,7 +2930,7 @@ class ServerHttp2Stream extends Http2Stream {
2931
2930
throw new ERR_HTTP2_HEADERS_AFTER_RESPOND ( ) ;
2932
2931
2933
2932
assertIsObject ( headers , 'headers' ) ;
2934
- headers = ObjectAssign ( ObjectCreate ( null ) , headers ) ;
2933
+ headers = ObjectAssign ( { __proto__ : null } , headers ) ;
2935
2934
2936
2935
debugStreamObj ( this , 'sending additional headers' ) ;
2937
2936
0 commit comments