Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeprecationWarning: OutgoingMessage.prototype._headers is deprecated #125

Open
mayconmesquita opened this issue May 23, 2020 · 3 comments
Open

Comments

@mayconmesquita
Copy link

mayconmesquita commented May 23, 2020

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.

@ghost
Copy link

ghost commented Oct 24, 2020

Is there any update to this?

@ElectronSz
Copy link

Is there any updates guys?

1 similar comment
@egoson
Copy link

egoson commented Dec 7, 2022

Is there any updates guys?

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

No branches or pull requests

3 participants