Skip to content

Commit

Permalink
feat(isUrl): higher priority to whitelist (#1748)
Browse files Browse the repository at this point in the history
* isUrl higher priority to whitelist

* remove extra line at end of package.json
  • Loading branch information
deepanshu2506 authored Oct 5, 2021
1 parent 4ec30b7 commit 13651ea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/isURL.js
Original file line number Diff line number Diff line change
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 13651ea

Please sign in to comment.