GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Get all headers 3992 by iankronquist · Pull Request #170 · nodejs/node

Conversation

@iankronquist

@iankronquist iankronquist commented Dec 16, 2014

Copy link
Copy Markdown
Contributor

Thanks @chrisdickinson for the pointer to this bug.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@piscisaureus piscisaureus added the unknown label Dec 16, 2014
@iankronquist

iankronquist commented Dec 16, 2014

Copy link
Copy Markdown
Contributor Author

Github doesn't automatically link to issues in the node.js repo. Here's a link to the issue in question:
nodejs/node-v0.x-archive#3992

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@piscisaureus piscisaureus removed the unknown label Dec 16, 2014
chrisdickinson
chrisdickinson reviewed Dec 16, 2014
View reviewed changes
Comment thread doc/api/http.markdown Outdated

@chrisdickinson chrisdickinson Dec 16, 2014

Copy link
Copy Markdown
Contributor

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.

I think there might be two too many newlines here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@iankronquist

iankronquist commented Dec 16, 2014

Copy link
Copy Markdown
Contributor Author

@chrisdickinson Fixed documentation formatting

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chrisdickinson
chrisdickinson reviewed Dec 18, 2014
View reviewed changes
Comment thread lib/_http_outgoing.js Outdated

@chrisdickinson chrisdickinson Dec 18, 2014

Copy link
Copy Markdown
Contributor

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.

It would be nice to return a copy of headers instead of the full object -- something like util.extend({}, this._headers).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@iankronquist

iankronquist commented Dec 20, 2014

Copy link
Copy Markdown
Contributor Author

@chrisdickinson Fixed according to your advice.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

phpnode
phpnode reviewed Dec 20, 2014
View reviewed changes
Comment thread doc/api/http.markdown Outdated

@phpnode phpnode Dec 20, 2014

Copy link
Copy Markdown

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.

Should probably be something like:

Returns the headers which have already been queued but not yet sent to the client.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@iankronquist
Add test for issue 3992
b4a670a
Test a getAllHeaders function. It should return an object representing
the headers in a request.
@iankronquist
iankronquist force-pushed the getAllHeaders-3992 branch from 9a2367e to 5bd1f5e Compare December 21, 2014 19:46
@iankronquist

iankronquist commented Dec 21, 2014

Copy link
Copy Markdown
Contributor Author

I made changes according to @phpnode's and @bnoordhuis' comments. I then rebased to keep up with v0.12. r?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chrisdickinson

chrisdickinson commented Dec 21, 2014

Copy link
Copy Markdown
Contributor

Apologies for dragging my feet on this a bit: this LGTM. If there are no objections I'll merge tomorrow afternoon (by 5PM PST).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@iankronquist

iankronquist commented Dec 21, 2014

Copy link
Copy Markdown
Contributor Author

@chrisdickinson No worries, I'm glad I could pitch in.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@iankronquist

iankronquist commented Dec 27, 2014

Copy link
Copy Markdown
Contributor Author

@chrisdickinson Can this be merged?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@piscisaureus piscisaureus closed this Dec 30, 2014
@piscisaureus piscisaureus reopened this Dec 30, 2014
@iankronquist

iankronquist commented Dec 30, 2014

Copy link
Copy Markdown
Contributor Author

ping @chrisdickinson

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chrisdickinson
chrisdickinson reviewed Dec 30, 2014
View reviewed changes
Comment thread test/internet/test-http-header-get-all.js Outdated

@chrisdickinson chrisdickinson Dec 30, 2014

Copy link
Copy Markdown
Contributor

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.

Sorry for the late comment, but wouldn't this omit the added-by-default headers Date and Connection?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@iankronquist

iankronquist commented Jan 6, 2015

Copy link
Copy Markdown
Contributor Author

@chrisdickinson updated according to your comments.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@iankronquist

iankronquist commented Jan 14, 2015

Copy link
Copy Markdown
Contributor Author

ping @chrisdickinson

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chrisdickinson
chrisdickinson reviewed Jan 14, 2015
View reviewed changes
Comment thread test/internet/test-http-header-get-all.js Outdated

@chrisdickinson chrisdickinson Jan 14, 2015

Copy link
Copy Markdown
Contributor

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.

var headers;
var rando = Math.random();
var expected = util._extend({}, {
  'X-Random-Thing': rando,
  /* other values */
});
var server = http.createServer(function(req, res) {
  res.setHeader('X-Random-Thing', rando); 
  headers = res.getAllHeaders();
  res.end('hello');
  assert.strictEqual(res.getAllHeaders(), null);
});
server.listen(common.PORT, function() {
  http.get({port: common.PORT}, function(resp) {
    assert.deepEqual(response.headers, expected);
    server.close();
  });
});

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@rvagg

rvagg commented Jan 27, 2015

Copy link
Copy Markdown
Member

@chrisdickinson do you require further action on this? Is your last comment a request for a test case along the lines of your code block? @iankronquist if this was to be merged it'd probably need to be a single commit so you might want to squash. The license block should also be removed from the test file and it now needs to go in to test/parallel/.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chrisdickinson

chrisdickinson commented Jan 27, 2015

Copy link
Copy Markdown
Contributor

Yes, that last comment is the test case that should be added and made to pass for this to be able to go in. Re: commits: I don't mind squashing those myself on merge.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@iankronquist

iankronquist commented Jan 27, 2015

Copy link
Copy Markdown
Contributor Author

@rvagg I'll go ahead and do that.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@iankronquist
Add a getAllHeaders function to the http module
427fd00
Users should not have to access private attributes like res._headers in
order to get all the headers in a request. Define a method getAllHeaders
to return an object which is a copy of re._headers

Fixes issue nodejs#3992
@iankronquist
iankronquist force-pushed the getAllHeaders-3992 branch from 8b9c94a to 427fd00 Compare January 27, 2015 17:56
@iankronquist

iankronquist commented Jan 27, 2015

Copy link
Copy Markdown
Contributor Author

... and squashed like a bug. Let me know if you need anything else cleaned up.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@karencapiiro karencapiiro mentioned this pull request Feb 11, 2024
[Snyk] Security upgrade npm-registry-fetch from 13.3.1 to 15.0.0 karencapiiro/node#71
Open
@Matthelonianxl Matthelonianxl mentioned this pull request Feb 11, 2024
[Snyk] Fix for 1 vulnerabilities Matthelonianxl/node#64
Open
@Verdinjoshua26 Verdinjoshua26 mentioned this pull request Feb 11, 2024
[Snyk] Fix for 1 vulnerabilities Verdinjoshua26/node#59
Open
@thisguy726 thisguy726 mentioned this pull request Feb 11, 2024
[Snyk] Fix for 1 vulnerabilities thisguy726/node#20
Open
@terrorizer1980 terrorizer1980 mentioned this pull request Feb 11, 2024
[Snyk] Fix for 1 vulnerabilities terrorizer1980/node-1#19
Open
@baophucct baophucct mentioned this pull request Feb 11, 2024
[Snyk] Fix for 1 vulnerabilities baophucct/node#46
Open
@kaocher82 kaocher82 mentioned this pull request Feb 11, 2024
[Snyk] Fix for 1 vulnerabilities Xtuden-com/node#44
Open
@sirinartk sirinartk mentioned this pull request Feb 11, 2024
[Snyk] Fix for 1 vulnerabilities sirinartk/node#55
Open
@Supermajestcd Supermajestcd mentioned this pull request Feb 12, 2024
[Snyk] Fix for 1 vulnerabilities Supermajestcd/node#23
Open
@ZRDK ZRDK mentioned this pull request Feb 12, 2024
[Snyk] Fix for 1 vulnerabilities ZRDK/node#71
Open
@dannybrown13 dannybrown13 mentioned this pull request Feb 12, 2024
[Snyk] Security upgrade npm-registry-fetch from 11.0.0 to 15.0.0 dannybrown13/node#86
Open
@timzwit timzwit mentioned this pull request Feb 12, 2024
[Snyk] Fix for 1 vulnerabilities timzwit/node#37
Open
@terrorizer1980 terrorizer1980 mentioned this pull request Feb 12, 2024
[Snyk] Fix for 1 vulnerabilities Exhorder6/node#29
Open
@myvali998 myvali998 mentioned this pull request Feb 12, 2024
[Snyk] Fix for 1 vulnerabilities myvali998/node#14
Open
@MrBrain295 MrBrain295 mentioned this pull request Feb 12, 2024
[Snyk] Fix for 1 vulnerabilities MrBrain295/node#32
Open
@nicholaschoi168 nicholaschoi168 mentioned this pull request Feb 12, 2024
[Snyk] Fix for 1 vulnerabilities nicholaschoi168/node#19
Open
@kissofire kissofire mentioned this pull request Feb 12, 2024
[Snyk] Fix for 1 vulnerabilities kissofire/node#120
Open
@molllyn1 molllyn1 mentioned this pull request Feb 12, 2024
[Snyk] Fix for 1 vulnerabilities molllyn1/node#103
Open
@JoanKalanzi1 JoanKalanzi1 mentioned this pull request Feb 12, 2024
[Snyk] Fix for 1 vulnerabilities JoanKalanzi1/node#18
Open
@137717unity 137717unity mentioned this pull request Feb 12, 2024
[Snyk] Fix for 1 vulnerabilities 137717unity/node#119
Open
@ambai ambai mentioned this pull request Feb 12, 2024
[Snyk] Security upgrade npm-registry-fetch from 13.3.1 to 15.0.0 ambai/node#74
Open
@luke7oaks luke7oaks mentioned this pull request Feb 12, 2024
[Snyk] Fix for 1 vulnerabilities luke7oaks/node-1#45
Open
@GregorFendt GregorFendt mentioned this pull request Feb 12, 2024
[Snyk] Fix for 1 vulnerabilities GregorFendt/node#32
Open
@AshdonG AshdonG mentioned this pull request May 7, 2024
[Snyk] Upgrade type-fest from 0.20.2 to 0.21.3 AshdonG/node#75
Open
eti-p-doray pushed a commit to eti-p-doray/node that referenced this pull request May 28, 2024
@backes @victorgomes
Avoid deprecated TypedArray::kMaxLength field (nodejs#170)
9b0e08c
Use TypedArray::kMaxByteLength instead.
syg pushed a commit to syg/node that referenced this pull request Jun 20, 2024
@backes @victorgomes
Avoid deprecated TypedArray::kMaxLength field (nodejs#170)
7a181b8
Use TypedArray::kMaxByteLength instead.
eti-p-doray pushed a commit to eti-p-doray/node that referenced this pull request Aug 28, 2024
@backes @victorgomes
Avoid deprecated TypedArray::kMaxLength field (nodejs#170)
127ff6a
Use TypedArray::kMaxByteLength instead.
@snyk-io snyk-io Bot mentioned this pull request Oct 21, 2024
[Snyk] Fix for 26 vulnerabilities Graybar-codespace/node#49
Open
syg pushed a commit to syg/node that referenced this pull request May 5, 2025
@backes pthier
Avoid deprecated TypedArray::kMaxLength field (nodejs#170)
957767d
Use TypedArray::kMaxByteLength instead.
bakkot pushed a commit to bakkot/node that referenced this pull request May 11, 2026
@backes pthier
Avoid deprecated TypedArray::kMaxLength field (nodejs#170)
938f00b
Use TypedArray::kMaxByteLength instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

http Issues and PRs related to the http subsystem. semver-minor PRs that contain new features and should be released in the next minor version.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

9 participants

@iankronquist @chrisdickinson @rvagg @Fishrock123 @vkurchatkin @bnoordhuis @phpnode @piscisaureus @brendanashworth
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.