Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http2: avoid Object.create(null) for Http2ServerRequest.headers #33183

Closed
wants to merge 4 commits into from

Conversation

rexagod
Copy link
Member

@rexagod rexagod commented May 1, 2020

Currently http2.Http2ServerRequest.headers returns headers which is initialized by Object.create(null) which is a different behaviour than what is seen in http.

Refs: #29829

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the http2 Issues or PRs related to the http2 subsystem. label May 1, 2020
@jasnell
Copy link
Member

jasnell commented May 1, 2020

The use of Object.create(null) in http/2 is intentional. For HTTP/1, the reason we do not use Object.create(null) for headers is because it would break too much code but it would have been preferable. I don't think this is one we want to change. A code comment to that effect would be good.

Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM % linter error.

@addaleax
Copy link
Member

Landed in ee87567 :)

@addaleax addaleax closed this May 19, 2020
addaleax pushed a commit that referenced this pull request May 19, 2020
Refs: #29829

PR-URL: #33183
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
codebytere pushed a commit that referenced this pull request May 21, 2020
Refs: #29829

PR-URL: #33183
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
codebytere pushed a commit that referenced this pull request Jun 7, 2020
Refs: #29829

PR-URL: #33183
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
codebytere pushed a commit to codebytere/node that referenced this pull request Jun 9, 2020
Refs: nodejs#29829

PR-URL: nodejs#33183
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
@codebytere codebytere mentioned this pull request Jun 9, 2020
@codebytere codebytere mentioned this pull request Jun 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
http2 Issues or PRs related to the http2 subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants