mirror of
https://github.com/spacebarchat/server.git
synced 2026-04-04 00:05:49 +00:00
wtf is wrong with ipdata
This commit is contained in:
@@ -143,6 +143,9 @@ router.post(
|
||||
|
||||
const ipData = await IpDataClient.getIpInfo(ip);
|
||||
if (ipData) {
|
||||
if(!ipData.threat) {
|
||||
console.log("Invalid IPData.co response, missing threat field", ipData);
|
||||
}
|
||||
const categories = Object.entries(ipData.threat)
|
||||
.filter(([key, value]) => key.startsWith("is_") && value === true)
|
||||
.map(([key]) => key.replace("is_", ""));
|
||||
|
||||
Reference in New Issue
Block a user