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

Fix #23 use getHeaders() instead of deprecated _headers #24

Merged
merged 2 commits into from
May 27, 2019
Merged

Fix #23 use getHeaders() instead of deprecated _headers #24

merged 2 commits into from
May 27, 2019

Conversation

bgornicki
Copy link
Contributor

By Node.js documentation:

The http module outgoingMessage._headers and outgoingMessage._headerNames properties are deprecated. Use one of the public methods (e.g. outgoingMessage.getHeader(), outgoingMessage.getHeaders(), outgoingMessage.getHeaderNames(), outgoingMessage.hasHeader(), outgoingMessage.removeHeader(), outgoingMessage.setHeader()) for working with outgoing headers.

It will fix [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated warning message.

@bgornicki
Copy link
Contributor Author

Unfortunately response.getHeaders() was added in v7.7.0 hence the check fails for Node v6.

@mcollina
Copy link
Member

Can you please add a check that calls getHeaders() if it’s there, or _headers otherwise?

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@jsumners jsumners left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Successfully merging this pull request may close these issues.

3 participants