Skip to content

Commit 24a7fae

Browse files
committed
Add check for autonomous system number in GeoIP data retrieval to prevent caching
1 parent 93232e1 commit 24a7fae

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

mongoose/enrich/geoip.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ def request_geoip(self, ip_address: str) -> Optional[Dict[Any, Any]]:
3333
reader = maxminddb.open_database(str(self.database_path))
3434
geoip_data = {}
3535
record = reader.get(ip_address)
36-
if not record:
36+
37+
if not record or not record.get("autonomous_system_number", None):
3738
raise IgnoreCacheException() # prevents caching
3839

3940
geoip_data["details"] = record.get("anonymous_ip", None)

0 commit comments

Comments
 (0)