express-redis-cache icon indicating copy to clipboard operation
express-redis-cache copied to clipboard

DeprecationWarning: OutgoingMessage.prototype._headers is deprecated

Open mayconmesquita opened this issue 4 years ago • 3 comments

Node version 12 deprecated OutgoingMessage.prototype._headers, which is used to create cache route.

The line using this._headers: ./node_modules/express-redis-cache/lib/ExpressRedisCache/route.js:200:30

Instead of using this._headers, we need to use obj.getHeaders() to get the headers object.

So we should replace the property name ._headers with the function .getHeaders(). Same results using either one except using the function is the supported method and removes the deprecation warning.

I'm preparing a Pull Request to solve this issue.

Edit: Pull Request opened (#126).

I used try/catch to make this compatible with all node versions.

mayconmesquita avatar May 23 '20 19:05 mayconmesquita

Is there any update to this?

ghost avatar Oct 24 '20 01:10 ghost

Is there any updates guys?

ElectronSz avatar Feb 18 '21 09:02 ElectronSz

Is there any updates guys?

egoson avatar Dec 07 '22 14:12 egoson