Skip to content

Commit 13651ea

Browse files
feat(isUrl): higher priority to whitelist (#1748)
* isUrl higher priority to whitelist * remove extra line at end of package.json
1 parent 4ec30b7 commit 13651ea

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/lib/isURL.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,15 @@ export default function isURL(url, options) {
145145
return false;
146146
}
147147

148+
if (options.host_whitelist) {
149+
return checkHost(host, options.host_whitelist);
150+
}
148151
if (!isIP(host) && !isFQDN(host, options) && (!ipv6 || !isIP(ipv6, 6))) {
149152
return false;
150153
}
151154

152155
host = host || ipv6;
153156

154-
if (options.host_whitelist && !checkHost(host, options.host_whitelist)) {
155-
return false;
156-
}
157157
if (options.host_blacklist && checkHost(host, options.host_blacklist)) {
158158
return false;
159159
}

0 commit comments

Comments
 (0)