mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
http2: comment on usage of Object.create(null)
Refs: https://github.com/nodejs/node/issues/29829 PR-URL: https://github.com/nodejs/node/pull/33183 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
committed by
Anna Henningsen
parent
0e92ae64f0
commit
ee8756760c
@@ -287,6 +287,9 @@ class Http2ServerRequest extends Readable {
|
||||
closed: false,
|
||||
didRead: false,
|
||||
};
|
||||
// Headers in HTTP/1 are not initialized using Object.create(null) which,
|
||||
// although preferable, would simply break too much code. Ergo header
|
||||
// initialization using Object.create(null) in HTTP/2 is intentional.
|
||||
this[kHeaders] = headers;
|
||||
this[kRawHeaders] = rawHeaders;
|
||||
this[kTrailers] = {};
|
||||
|
||||
Reference in New Issue
Block a user