follow whois referral

This commit is contained in:
HF 2022-08-04 16:06:19 +02:00
parent 0a89bd83b3
commit c70e31f944

View File

@ -71,7 +71,21 @@ function parseWhois(ip, whoisData) {
}
async function whois(ip) {
const whoisData = await whoiser.ip(ip);
let whoisData = await whoiser.ip(ip);
if (whoisData.ReferralServer) {
let referral = whoisData.ReferralServer;
const prot = referral.indexOf('://');
if (prot !== -1) {
referral = referral.slice(prot + 3);
}
try {
whoisData = await whoiser.ip(ip, {
host: referral,
});
} catch {
// nothing
}
}
return parseWhois(ip, whoisData);
}