Do not attempt to DNS resolve localhost Fixes #4290

21d4c37846790a1ef4285d6c5aaa17ff14fa41b5

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +2 -4Showing whitespace changes
src/command-line.js+2 -4
@@ -4,7 +4,7 @@ import yargs from 'yargs/yargs';
44import { hideBin } from 'yargs/helpers';
55import ipRegex from 'ip-regex';
66import envPaths from 'env-paths';
77import { canResolve, color, getConfigValue, stringToBool } from './util.js';
88import { initConfig } from './config-init.js';
99
1010/**
@@ -314,10 +314,8 @@ export class CommandLineParser {
314314 },
315315 getBrowserLaunchHostname: async function ({ useIPv6, useIPv4 }) {
316316 if (this.browserLaunchHostname === 'auto') {
317- const localhostResolve = await canResolve('localhost', useIPv6, useIPv4);
318-
319317 if (useIPv6 && useIPv4) {
320318 return (this.browserLaunchAvoidLocalhost || !localhostResolve) ? '[::1]' : 'localhost';
321319 }
322320
323321 if (useIPv6) {