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

Response object does not have response.headers #71

Closed
parshap opened this issue Oct 31, 2014 · 2 comments
Closed

Response object does not have response.headers #71

parshap opened this issue Oct 31, 2014 · 2 comments

Comments

@parshap
Copy link

parshap commented Oct 31, 2014

The response object in Node's http module (an instance of http.IncomingMessage) exposes the response headers via response.headers (and not response.getHeader()). This module does the opposite - http-browserify's response object has response.getHeader() (and not response.headers).

The response object should be changed to match Node core's http module by adding .headers and removing .getHeader().

@parshap
Copy link
Author

parshap commented Oct 31, 2014

Sorry. It looks like the response object does indeed have .headers. This is just not documented in the readme. It also does have .getHeader() (which is documented in the readme) even though the node http module does not - but I guess that's ok.

parshap added a commit to parshap/http-browserify that referenced this issue Oct 31, 2014
See browserify#71. The Node http module's response object has `response.headers`, not `response.getHeader()`. The *http-browserify* module provides both, but previously only documented `response.getHeader()`. This changes the documentation to document `response.headers` instead. The `response.getHeader()` function is left undocumented as technically it does not match the node http module implementation.
@parshap
Copy link
Author

parshap commented Oct 31, 2014

Sent a pull request to change the documentation - see #72.

Closing this now, but you may want to remove response.getHeader() in the future to be strictly equivalent to node's http module.

@parshap parshap closed this as completed Oct 31, 2014
parshap added a commit to parshap/http-browserify that referenced this issue Oct 31, 2014
See browserify#71. The Node http module's response object has `response.headers`, not `response.getHeader()`. The *http-browserify* module provides both, but previously only documented `response.getHeader()`. This changes the documentation to document `response.headers` instead. The `response.getHeader()` function is left undocumented as technically it does not match the node http module implementation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant