Open twhitner-vistaprint opened 5 years ago
Do you mind use the solution here so that it doesn't need an extra dependency?
'res-headers': (res.getHeaders && res.getHeaders()) || res._headers,
We are also looking forward to this fix, @twhitner-vistaprint are you free to update the pr to use the simplified logic @zorji suggested?
(node:45346) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
(Use `node --trace-deprecation ...` to show where the warning was created)
...
(node:45363) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
at ServerResponse.logging (~/myapp/node_modules/express-bunyan-logger/index.js:130:36)
at ServerResponse.emit (events.js:327:22)
at ServerResponse.EventEmitter.emit (domain.js:486:12)
at onFinish (_http_outgoing.js:766:10)
at callback (_stream_writable.js:513:21)
at afterWrite (_stream_writable.js:466:5)
at afterWriteTick (_stream_writable.js:453:10)
at processTicksAndRejections (internal/process/task_queues.js:79:21)
``
I have merged the fix in my own updated fork at: https://www.npmjs.com/package/@chaudhryjunaid/express-bunyan-logger
https://nodejs.org/api/deprecations.html#deprecations_dep0066_outgoingmessage_prototype_headers_outgoingmessage_prototype_headernames