mirror of
https://github.com/spacebarchat/server.git
synced 2026-04-28 10:35:39 +00:00
Drop isProxy alltogether, because wtf is this language (!![] === true apparently) - Fixes #1444
This commit is contained in:
@@ -164,11 +164,6 @@ router.post(
|
|||||||
console.log(`[Register] ${ip} blocked from registration: IPData.co ASN ${ipData.asn.name} is blocked`);
|
console.log(`[Register] ${ip} blocked from registration: IPData.co ASN ${ipData.asn.name} is blocked`);
|
||||||
throw new HTTPError("Your IP is blocked from registration");
|
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");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,13 +23,4 @@ export class IpDataClient {
|
|||||||
});
|
});
|
||||||
return await resp;
|
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user