Skip to content

Commit 1fce18c

Browse files
committed
http2: comment on usage of Object.create(null)
Refs: #29829
1 parent e951825 commit 1fce18c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/internal/http2/compat.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,10 @@ class Http2ServerRequest extends Readable {
287287
closed: false,
288288
didRead: false,
289289
};
290+
// headers in HTTP/1 are not initialized using Object.create(null)
291+
// which, although preferable, simply breaks too much code.
292+
// Ergo, header initialization using Object.create(null) in HTTP/2
293+
// is intentional.
290294
this[kHeaders] = headers;
291295
this[kRawHeaders] = rawHeaders;
292296
this[kTrailers] = {};

0 commit comments

Comments
 (0)