diff --git a/lib/internal/http2/compat.js b/lib/internal/http2/compat.js index 479510152c9522..9c49d52b5d37d7 100644 --- a/lib/internal/http2/compat.js +++ b/lib/internal/http2/compat.js @@ -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] = {};