Skip to content

Commit

Permalink
fix: update if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
btea committed Aug 3, 2023
1 parent f94960f commit c624cc0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/vite/src/node/utils.ts
Expand Up @@ -867,7 +867,11 @@ export async function resolveHostname(
host = undefined // undefined typically means 0.0.0.0 or :: (listen on all IPs)
} else {
// check if the host is valid
if (!net.isIP(optionsHost)) {
if (
optionsHost !== 'localhost' &&
!wildcardHosts.has(optionsHost) &&
!net.isIP(optionsHost)
) {
throw new Error(
`The address passed to --host is not a valid IP address: ${optionsHost}`,
)
Expand Down

0 comments on commit c624cc0

Please sign in to comment.