Skip to content

Commit 112012a

Browse files
committed
only allow loopback address to use server ip for geoloc
1 parent 0494516 commit 112012a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/state/services.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def __fetch_geoloc_nginx(headers: Mapping[str, str]) -> Geolocation | None:
196196

197197
async def _fetch_geoloc_from_ip(ip: IPAddress) -> Geolocation | None:
198198
"""Fetch geolocation data based on ip (using ip-api)."""
199-
if not ip.is_private:
199+
if not ip.is_loopback:
200200
url = f"http://ip-api.com/line/{ip}"
201201
else:
202202
url = "http://ip-api.com/line/"

0 commit comments

Comments
 (0)