-
-
Notifications
You must be signed in to change notification settings - Fork 36.3k
http2: add headersDistinct to Http2ServerRequest fixes #64060 #64071
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4189,6 +4189,53 @@ removeAllHeaders(request.headers); | |
| assert(request.url); // Fails because the :path header has been removed | ||
| ``` | ||
|
|
||
| #### `request.headersDistinct` | ||
|
|
||
| <!-- YAML | ||
| added: | ||
| - v18.3.0 | ||
| - v16.17.0 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In whichever doc you keep, the version number here should be left as a placeholder. It'll be automatically filled out when this is released, like so: |
||
| --> | ||
|
|
||
| * Type: {Object} | ||
|
|
||
| Similar to [`request.headers`][], but there is no join logic and the values are | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This link name is defined in http.md but not here in http2.md. If you want to keep it in the de-dupe, we'll need another definition here to make the link work. You can see those at the bottom of the file, just add this in there alphabetically. |
||
| always arrays of strings, even for headers received just once. | ||
|
|
||
| The object has a null prototype and should not be accessed using the `in` | ||
| operator. | ||
|
|
||
| ```js | ||
| // Prints something like: | ||
| // | ||
| // { 'user-agent': ['curl/7.22.0'], | ||
| // host: ['127.0.0.1:8000'], | ||
| // accept: ['*/*'] } | ||
| console.log(request.headersDistinct); | ||
| ``` | ||
|
|
||
| <!-- YAML | ||
| added: v8.4.0 | ||
| --> | ||
|
|
||
| * Type: {Object} | ||
|
|
||
| Similar to `request.headers`, but preserves duplicate header values. | ||
| Each property is an array containing all values received for that header. | ||
|
|
||
| The object has a null prototype and should not be accessed using the `in` | ||
| operator. | ||
|
|
||
| ```js | ||
| // Prints something like: | ||
| // | ||
| // { | ||
| // host: ['127.0.0.1:8000'], | ||
| // accept: ['text/html', 'application/json'] | ||
| // } | ||
| console.log(request.headersDistinct); | ||
| ``` | ||
|
|
||
| #### `request.httpVersion` | ||
|
|
||
| <!-- YAML | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs here are duplicated. One of these needs removing.