Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

public res.headers #3992

Closed
tj opened this issue Sep 10, 2012 · 9 comments
Closed

public res.headers #3992

tj opened this issue Sep 10, 2012 · 9 comments
Labels
Milestone

Comments

@tj
Copy link

tj commented Sep 10, 2012

pretty lame to use res._headers for logging

langpavel added a commit to langpavel/node that referenced this issue Sep 18, 2012
Reads out all headers that's already been queued but not sent to the
client.
Keys are proper-case as they will (or was) sent.  Usefull for logging

Example:

```js
console.log(response.getHeaders());
// { 'Content-Type': 'text/plain' }
```

This addressed nodejs#3992
@langpavel
Copy link

@visionmedia please review 82a6d45

@isaacs
Copy link

isaacs commented Dec 30, 2012

Planning a significant http refactor for 0.12. Let's do this then.

@indutny
Copy link
Member

indutny commented Feb 28, 2014

I guess this could be closed, right? We have res.getHeaders() now.

@indutny indutny closed this as completed Feb 28, 2014
@tj
Copy link
Author

tj commented Mar 1, 2014

hmm it would be a lot better if we just exposed a nicer populated object but that works I suppose

@indutny indutny reopened this Mar 1, 2014
@indutny
Copy link
Member

indutny commented Mar 1, 2014

Ok, reopened.

@iankronquist
Copy link

I would like to claim this, as was discussed on IRC.

Fishrock123 pushed a commit to Fishrock123/node that referenced this issue Feb 9, 2015
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 res._headers

Fixes: nodejs/node-v0.x-archive#3992
PR-URL: nodejs#170
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Chris Dickinson <[email protected]>
@jasnell
Copy link
Member

jasnell commented May 18, 2015

@indutny ... just confirming, this landed in io.js already correct?

@jasnell
Copy link
Member

jasnell commented May 20, 2015

Deferring to the io.js discussion on this. see nodejs/node#772

@jasnell jasnell closed this as completed May 20, 2015
@Fishrock123
Copy link

In summary: this a huge headache now, probably requires the http re-write to have a reasonable and long-term API.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants