Skip to content

Commit

Permalink
Revert "feat(isUrl): higher priority to whitelist (validatorjs#1748)"
Browse files Browse the repository at this point in the history
This reverts commit 13651ea.

reverted
  • Loading branch information
rohitnairtech committed Oct 23, 2021
1 parent 4f21dd8 commit 2371e49
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/isURL.js
Expand Up @@ -145,15 +145,15 @@ export default function isURL(url, options) {
return false;
}

if (options.host_whitelist) {
return checkHost(host, options.host_whitelist);
}
if (!isIP(host) && !isFQDN(host, options) && (!ipv6 || !isIP(ipv6, 6))) {
return false;
}

host = host || ipv6;

if (options.host_whitelist && !checkHost(host, options.host_whitelist)) {
return false;
}
if (options.host_blacklist && checkHost(host, options.host_blacklist)) {
return false;
}
Expand Down

0 comments on commit 2371e49

Please sign in to comment.