Skip to content

Commit 44f3b23

Browse files
lpincamarco-ippolito
authored andcommitted
dns: honor the order option
Fixes: #55391 PR-URL: #55392 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Tim Perry <pimterry@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Feng Yu <F3n67u@outlook.com> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
1 parent 5eb6c94 commit 44f3b23

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/dns.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ function lookup(hostname, options, callback) {
193193
}
194194
if (options?.order != null) {
195195
validateOneOf(options.order, 'options.order', ['ipv4first', 'ipv6first', 'verbatim']);
196-
dnsOrder = options.dnsOrder;
196+
dnsOrder = options.order;
197197
}
198198
}
199199

test/parallel/test-dns-default-order-verbatim.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,14 @@ function allowFailed(fn) {
4646

4747
await allowFailed(dnsPromises.lookup('example.org', {}));
4848
checkParameter(cares.DNS_ORDER_VERBATIM);
49+
50+
await allowFailed(
51+
promisify(dns.lookup)('example.org', { order: 'ipv4first' })
52+
);
53+
checkParameter(cares.DNS_ORDER_IPV4_FIRST);
54+
55+
await allowFailed(
56+
promisify(dns.lookup)('example.org', { order: 'ipv6first' })
57+
);
58+
checkParameter(cares.DNS_ORDER_IPV6_FIRST);
4959
})().then(common.mustCall());

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy