dns: accept 'IPv4' and 'IPv6' for family

Refs: https://github.com/nodejs/node/issues/43014

PR-URL: https://github.com/nodejs/node/pull/43054
Fixes: https://github.com/nodejs/node/issues/43014
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
Antoine du Hamel authored and Michael Dawson committed 2022-06-15 18:02:01 -04:00
1 parent 74716ada2e
commit 70b516e4db
27 files changed
+88 -54

No files matched your search

+2 -2
View File
@@ -39,10 +39,10 @@ const internalInterfaces = Object.values(os.networkInterfaces()).flat().filter(
);
for (const iface of internalInterfaces) {
testListeningOptions.push({
hostname: iface?.family === 6 ? `[${iface.address}]` : iface?.address,
hostname: iface?.family === 'IPv6' ? `[${iface?.address}]` : iface?.address,
listenOptions: {
host: iface?.address,
ipv6Only: iface?.family === 6
ipv6Only: iface?.family === 'IPv6'
}
});
}