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

Use res.getHeaders() to avoid deprecation warning #1503

Merged
merged 3 commits into from
Dec 1, 2019
Merged

Use res.getHeaders() to avoid deprecation warning #1503

merged 3 commits into from
Dec 1, 2019

Conversation

ad-m
Copy link
Contributor

@ad-m ad-m commented Aug 11, 2019

See #1502

@ad-m ad-m changed the title Use res.getHeaders() to avoid depr-warning Use res.getHeaders() to avoid deprecation warning Aug 11, 2019
@thw0rted
Copy link

thw0rted commented Aug 29, 2019

This isn't the only place where _headers is referenced, just look down a few lines in the file you changed. See my comments on the linked issue for more details. ETA: I misunderstood how the local headers var was being used, so it should be enough to just replace subsequent references to req._headers with the local headers.

@thw0rted
Copy link

Also: on L509 and L522, I think the headers = is extraneous. The method returns a reference to its first parameter, which is going to have to be headers anyway, so the assignment will do nothing.

@niftylettuce
Copy link
Collaborator

Do we need tests added?

@ad-m
Copy link
Contributor Author

ad-m commented Sep 24, 2019

Rebased to build on Node 12. Added --throw-deprecation to fail (see https://devdocs.io/mocha/ detail), when deprecated method used.

@ad-m
Copy link
Contributor Author

ad-m commented Oct 24, 2019

Is there anything what I can do to help merge that PR?

@busticated
Copy link

hi all 👋

thanks for all the work in pulling this together and maintaining this lib over the years 🙏🙇

fwiw, this is blocking formal node@12 support over in https://github.com/particle-iot/particle-cli (see failing tests here).

i'd be happy to pitch in w/ additional fixes and / or testing as you see fit 👍

@niftylettuce niftylettuce merged commit 8dc8b91 into ladjs:master Dec 1, 2019
@niftylettuce
Copy link
Collaborator

niftylettuce commented Dec 1, 2019

v5.1.2 is released to npm and everything should be fine with latest versions of Node now 🎉

If you find any further deprecation warnings in the future please let me know!

npm install superagent@latest

or with yarn:

yarn add superagent@latest

https://github.com/visionmedia/superagent/releases/tag/v5.1.2

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.

4 participants