You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a use case where I need a list of all currently set headers. This is possible with the unofficial res._headers property. It would be great if there would be an official way to get this information.
Maybe the response object could be extended with this: res.getHeaders();
This would then return a copy of the currently set headers.
Does this seem like a good idea?
The text was updated successfully, but these errors were encountered:
Oh ok. I didn't know that.
Sadly we are stuck with supporting 4.x.x and up so this is not a solution for us.
I can however make our implementation future proof by checking the availability of this new function before using res._headers.
Yea, we don't shadow or shim APIs in Express.js, just the additional sugar that is needed. nodejs/node#10805 is the PR in Node.js and it's been requested to be backported to Node.js 6.x multiple times, I think you can request it be backported to 4.x as well, though.
I have a use case where I need a list of all currently set headers. This is possible with the unofficial
res._headers
property. It would be great if there would be an official way to get this information.Maybe the response object could be extended with this:
res.getHeaders();
This would then return a copy of the currently set headers.
Does this seem like a good idea?
The text was updated successfully, but these errors were encountered: