wtf is wrong with ipdata

This commit is contained in:
Rory&
2025-12-03 20:00:26 +01:00
parent f39d7f2c7e
commit a5a520be06

View File

@@ -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_", ""));