Skip to content

DeprecationWarning: OutgoingMessage.prototype._headers is deprecated #125

@mayconmesquita

Description

@mayconmesquita

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions