From 1e2a6492474675730d759f378d2acc78068892f7 Mon Sep 17 00:00:00 2001 From: treysis Date: Fri, 3 Sep 2021 23:53:47 +0200 Subject: [PATCH] dns: added suggestion from comments PR-URL: https://github.com/nodejs/node/pull/39987 Fixes: https://github.com/nodejs/node/issues/31566 Refs: https://github.com/nodejs/node/issues/6307 Refs: https://github.com/nodejs/node/pull/20710 Refs: https://github.com/nodejs/node/pull/38099 Reviewed-By: Antoine du Hamel Reviewed-By: Matteo Collina Reviewed-By: James M Snell Reviewed-By: Michael Dawson --- lib/internal/dns/utils.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/internal/dns/utils.js b/lib/internal/dns/utils.js index e73300e00049e3..28109367e36c5a 100644 --- a/lib/internal/dns/utils.js +++ b/lib/internal/dns/utils.js @@ -196,14 +196,7 @@ function emitInvalidHostnameWarning(hostname) { let dnsOrder = getOptionValue('--dns-result-order') || 'verbatim'; function getDefaultVerbatim() { - switch (dnsOrder) { - case 'verbatim': - return true; - case 'ipv4first': - return false; - default: - return true; - } + return dnsOrder !== 'ipv4first'; } function setDefaultResultOrder(value) {