Skip to content

"message.headers" incorrectly shows use of "console.log(request.getHeaders());" as an example. #44567

New issue

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

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

Already on GitHub? # to your account

Closed
Det87 opened this issue Sep 8, 2022 · 0 comments · Fixed by #44587
Closed
Labels
doc Issues and PRs related to the documentations. http Issues or PRs related to the http subsystem.

Comments

@Det87
Copy link

Det87 commented Sep 8, 2022

Affected URL(s)

https://nodejs.org/docs/latest-v16.x/api/http.html#messageheaders
https://nodejs.org/docs/latest-v18.x/api/http.html#messageheaders

Description of the problem

With req.getHeaders(), you get an error:

$ node <name>.js
<go to: http://localhost:<port>/>
[...]
TypeError: req.getHeaders is not a function

with req.headers, you don't.

However, the example in the docs (both v16 and v18) shows the (non-working) use of:
console.log(request.getHeaders());

..under the sub-section message.headers.

@Det87 Det87 added the doc Issues and PRs related to the documentations. label Sep 8, 2022
@MoLow MoLow added the http Issues or PRs related to the http subsystem. label Sep 8, 2022
lpinca added a commit to lpinca/node that referenced this issue Sep 10, 2022
lpinca added a commit to lpinca/node that referenced this issue Sep 10, 2022
nodejs-github-bot pushed a commit that referenced this issue Sep 12, 2022
Fixes: #44567
PR-URL: #44587
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Mestery <mestery@protonmail.com>
Fyko pushed a commit to Fyko/node that referenced this issue Sep 15, 2022
Fixes: nodejs#44567
PR-URL: nodejs#44587
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Mestery <mestery@protonmail.com>
RafaelGSS pushed a commit that referenced this issue Sep 26, 2022
Fixes: #44567
PR-URL: #44587
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Mestery <mestery@protonmail.com>
RafaelGSS pushed a commit that referenced this issue Sep 26, 2022
Fixes: #44567
PR-URL: #44587
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Mestery <mestery@protonmail.com>
RafaelGSS pushed a commit that referenced this issue Sep 26, 2022
Fixes: #44567
PR-URL: #44587
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Mestery <mestery@protonmail.com>
juanarbol pushed a commit that referenced this issue Oct 4, 2022
Fixes: #44567
PR-URL: #44587
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Mestery <mestery@protonmail.com>
juanarbol pushed a commit that referenced this issue Oct 4, 2022
Fixes: #44567
PR-URL: #44587
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Mestery <mestery@protonmail.com>
juanarbol pushed a commit that referenced this issue Oct 4, 2022
Fixes: #44567
PR-URL: #44587
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Mestery <mestery@protonmail.com>
juanarbol pushed a commit that referenced this issue Oct 7, 2022
Fixes: #44567
PR-URL: #44587
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Mestery <mestery@protonmail.com>
juanarbol pushed a commit that referenced this issue Oct 10, 2022
Fixes: #44567
PR-URL: #44587
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Mestery <mestery@protonmail.com>
juanarbol pushed a commit that referenced this issue Oct 11, 2022
Fixes: #44567
PR-URL: #44587
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Mestery <mestery@protonmail.com>
guangwong pushed a commit to noslate-project/node that referenced this issue Jan 3, 2023
Fixes: nodejs/node#44567
PR-URL: nodejs/node#44587
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Mestery <mestery@protonmail.com>
guangwong pushed a commit to noslate-project/node that referenced this issue Jan 3, 2023
Fixes: nodejs/node#44567
PR-URL: nodejs/node#44587
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Mestery <mestery@protonmail.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
doc Issues and PRs related to the documentations. http Issues or PRs related to the http subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants