do whois also for blacklisted and whitelisted ips

This commit is contained in:
HF 2022-08-03 01:05:12 +02:00
parent f43b786f31
commit 20eaafa369

View File

@ -137,13 +137,17 @@ async function saveIPInfo(ip, isProxy, info) {
async function withoutCache(f, ip) {
if (!ip) return true;
const ipKey = getIPv6Subnet(ip);
let result;
let info;
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);
return result;
}