-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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: type check for dns.setServers argument. #21944
Conversation
Added type check for argument for dns.setServers and dnsPromises.setServers.
const dns = require('dns'); | ||
const resolver = new dns.promises.Resolver(); | ||
const dnsPromises = dns.promises; | ||
const promiseResolver = new dns.promises.Resolver(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this needs to be in test/internet
, right? It only sets servers, not actually tries to send out DNS requests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@addaleax Thanks for your review. Should I move this test to test/parallel
or other?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I think the new test file can be in test/parallel
, not test/internet
@addaleax @maclover7 moved the test file to |
718dbcd
to
e68ca4f
Compare
node-test-commit-freebsd failed but I think it is not related this PR. Console Output shows the below error log.
|
Resumed build: https://ci.nodejs.org/job/node-test-pull-request/16116/ |
Landed in 4e1c4e8 |
Added type check for argument for dns.setServers and dnsPromises.setServers. PR-URL: #21944 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Сковорода Никита Андреевич <[email protected]>
@nodejs/tsc @nodejs/release This should be semver-major because it introduces a two new |
I think common sense says no, but our policies say yes. :/ The input values would already have been something with a |
I think this is affecting only the new, experimental, promise API. So, this could land in Node 10 (because of experimental). |
@mcollina This affects dns.setServers, not only dnsPromises.setServers. const dns = require('dns');
const host = 'google.com'
dns.resolve4(host, ip=>{
dns.setServers([ip]);
}) 10.7.0 output
this output
|
Added type check for argument for dns.setServers and dnsPromises.setServers.
Refs #21930
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes