node-bunyan
node-bunyan copied to clipboard
Use the parsed response headers
@KyleAMathews Hrm. Are those always there? IIRC res._headers either isn't always set or wasn't always set in some versions of node. Perhaps this has changed in recent node versions -- it is an internal var (_-prefixed) after all. Changing the "std serializer" is a compat issue as well to think about. Obviously, if available already, the parse headers are way more useful to have in logs.
Hmmm... that might be true. It's been a long time since I've used older versions of node :)
Perhaps include both and check for the existence of _headers before including them? Or only not include _header if _headers does exist?
Any progress on this? I'm using v0.10.33 and the headers are absent.
@qubyte No. I don't know the promise (if any) that node makes for res._headers being set (or res._header for that matter). FWIW, node-restify has a res serializer that uses res.headers.
Hello, i am having the same issue here, how about using res.getHeaders() instead? I'm using express 4.16.1(latest version)
i have created a pull request on this #671