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

dns: deprecate passing falsy hostname to dns.lookup #23173

Closed
wants to merge 7 commits into from

Conversation

oyyd
Copy link
Contributor

@oyyd oyyd commented Sep 30, 2018

We can dns.lookup a falsy hostname like dns.lookup(false)
for the reason of backwards compatibility long before(see #13119
for detail). This behavior is undocumented and seems useless in
real world apps.

We could also make invalid hostname throw in the future and the
change might be semver-major.

Fixes: #13119

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

We can `dns.lookup` a falsy `hostname` like `dns.lookup(false)`
for the reason of backwards compatibility long before(see nodejs#13119
for detail). This behavior is undocumented and seems useless in
real world apps.

We could also make invalid `hostname` throw in the future and the
change might be semver-major.

Fixes: nodejs#13119
@nodejs-github-bot nodejs-github-bot added the dns Issues and PRs related to the dns subsystem. label Sep 30, 2018
@addaleax addaleax added semver-major PRs that contain breaking changes and should be released in the next major version. deprecations Issues and PRs related to deprecations. labels Sep 30, 2018
@addaleax
Copy link
Member

If you look around for other uses of DeprecationWarning in lib/, you’ll see that each of them has a deprecation code – these correspond to the ones listed in doc/api/deprecations.md, and I think this would also need an entry there?

@oyyd
Copy link
Contributor Author

oyyd commented Sep 30, 2018

Oh, I thought they are only used in markdowns. Thanks, I'm going to add a deprecation code.

@oyyd
Copy link
Contributor Author

oyyd commented Sep 30, 2018

Add a new deprecation code and the travis ci is green now.

Copy link
Contributor

@vsemozhetbyt vsemozhetbyt left a comment

Choose a reason for hiding this comment

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

Thank you. Just some doc nits)

doc/api/deprecations.md Outdated Show resolved Hide resolved
doc/api/deprecations.md Outdated Show resolved Hide resolved
doc/api/deprecations.md Outdated Show resolved Hide resolved
Copy link
Member

@lundibundi lundibundi left a comment

Choose a reason for hiding this comment

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

LGTM with a few doc nits.

doc/api/deprecations.md Outdated Show resolved Hide resolved
doc/api/deprecations.md Outdated Show resolved Hide resolved
doc/api/deprecations.md Outdated Show resolved Hide resolved
doc/api/deprecations.md Outdated Show resolved Hide resolved
doc/api/deprecations.md Outdated Show resolved Hide resolved
doc/api/deprecations.md Outdated Show resolved Hide resolved
doc/api/deprecations.md Outdated Show resolved Hide resolved
@BridgeAR
Copy link
Member

BridgeAR commented Oct 2, 2018

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Oct 2, 2018
@danbev
Copy link
Contributor

danbev commented Oct 4, 2018

Re-run of failing node-test-commit-windows-fanned

@addaleax
Copy link
Member

addaleax commented Oct 4, 2018

Landed in 26af728 🎉

Thanks for the PR!

@addaleax addaleax closed this Oct 4, 2018
addaleax pushed a commit that referenced this pull request Oct 4, 2018
We can `dns.lookup` a falsy `hostname` like `dns.lookup(false)`
for the reason of backwards compatibility long before(see #13119
for detail). This behavior is undocumented and seems useless in
real world apps.

We could also make invalid `hostname` throw in the future and the
change might be semver-major.

Fixes: #13119

PR-URL: #23173
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
jasnell pushed a commit that referenced this pull request Oct 17, 2018
We can `dns.lookup` a falsy `hostname` like `dns.lookup(false)`
for the reason of backwards compatibility long before(see #13119
for detail). This behavior is undocumented and seems useless in
real world apps.

We could also make invalid `hostname` throw in the future and the
change might be semver-major.

Fixes: #13119

PR-URL: #23173
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. deprecations Issues and PRs related to deprecations. dns Issues and PRs related to the dns subsystem. semver-major PRs that contain breaking changes and should be released in the next major version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dns.lookup allows a "falsy" hostname, but behaviour is undocumented and appears useless
10 participants