Drop isProxy alltogether, because wtf is this language (!![] === true apparently) - Fixes #1444

This commit is contained in:
Rory&
2025-12-18 23:29:04 +01:00
parent a8375d75fb
commit b54e86dd4d
2 changed files with 0 additions and 14 deletions

View File

@@ -164,11 +164,6 @@ router.post(
console.log(`[Register] ${ip} blocked from registration: IPData.co ASN ${ipData.asn.name} is blocked`);
throw new HTTPError("Your IP is blocked from registration");
}
if (register.blockProxies && IpDataClient.isProxy(ipData)) {
console.log(`[Register] ${ip} blocked from registration: IPData.co response matched IpDataClient.isProxy() check`);
throw new HTTPError("Your IP is blocked from registration");
}
}
}

View File

@@ -23,13 +23,4 @@ export class IpDataClient {
});
return await resp;
}
//TODO add function that support both ip and domain names
static isProxy(data: IpDataIpLookupResponse) {
if (!data || !data.asn || !data.threat) return false;
if (data.asn.type !== "isp") return true;
if (Object.values(data.threat).some((x) => x)) return true;
return false;
}
}