do whois also for blacklisted and whitelisted ips
This commit is contained in:
parent
f43b786f31
commit
20eaafa369
|
@ -137,13 +137,17 @@ async function saveIPInfo(ip, isProxy, info) {
|
||||||
async function withoutCache(f, ip) {
|
async function withoutCache(f, ip) {
|
||||||
if (!ip) return true;
|
if (!ip) return true;
|
||||||
const ipKey = getIPv6Subnet(ip);
|
const ipKey = getIPv6Subnet(ip);
|
||||||
|
let result;
|
||||||
|
let info;
|
||||||
if (await isWhitelisted(ipKey)) {
|
if (await isWhitelisted(ipKey)) {
|
||||||
return false;
|
result = false;
|
||||||
|
info = 'wl';
|
||||||
|
} else if (await isBlacklisted(ipKey)) {
|
||||||
|
result = true;
|
||||||
|
info = 'bl';
|
||||||
|
} else {
|
||||||
|
[result, info] = await f(ip);
|
||||||
}
|
}
|
||||||
if (await isBlacklisted(ipKey)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
const [result, info] = await f(ip);
|
|
||||||
saveIPInfo(ipKey, result, info);
|
saveIPInfo(ipKey, result, info);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user