Support blacklist with port
This commit is contained in:
parent
938fe9f752
commit
1bd2bf1ae3
2 changed files with 9 additions and 2 deletions
|
@ -4,9 +4,9 @@ const includes = (blacklist, url) => {
|
|||
let u = new URL(url);
|
||||
return blacklist.some((item) => {
|
||||
if (!item.includes('/')) {
|
||||
return re.fromWildcard(item).test(u.hostname);
|
||||
return re.fromWildcard(item).test(u.host);
|
||||
}
|
||||
return re.fromWildcard(item).test(u.hostname + u.pathname);
|
||||
return re.fromWildcard(item).test(u.host + u.pathname);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Reference in a new issue