/status/data endpoint fixes.
This commit is contained in:
@@ -215,12 +215,19 @@ def graph_data():
|
||||
level = 1
|
||||
anon_ips = []
|
||||
for iface in ifaces:
|
||||
addr_json = iface.get("addresses_json")
|
||||
try:
|
||||
addrs = json.loads(iface.get("addresses_json", "[]"))
|
||||
except (json.JSONDecodeError, TypeError):
|
||||
if addr_json is None:
|
||||
addrs = []
|
||||
else:
|
||||
addrs = json.loads(addr_json)
|
||||
if not isinstance(addrs, list):
|
||||
addrs = []
|
||||
except (json.JSONDecodeError, TypeError, AttributeError):
|
||||
addrs = []
|
||||
|
||||
for addr in addrs:
|
||||
ip_bare = addr.split("/")[0]
|
||||
ip_bare = addr.split("/")[0] if isinstance(addr, str) else str(addr)
|
||||
if is_public_ip(ip_bare):
|
||||
level = 0
|
||||
anon_ips.append(anonymize_ip(addr))
|
||||
|
||||
Reference in New Issue
Block a user