From 72ad0e9e7bdd3ee26d025a5a8e1b14d471b32d58 Mon Sep 17 00:00:00 2001 From: trinkey Date: Sat, 8 Mar 2025 10:29:57 -0500 Subject: [PATCH] fix ipv6 parsing --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index d0d2dec..b73abf7 100644 --- a/main.py +++ b/main.py @@ -49,7 +49,7 @@ def get_ip() -> str: ip = (flask.request.headers.get("X-Real-IP") if REVERSE_PROXY else flask.request.remote_addr) or "0.0.0.0" if ":" in ip: - ip = ip[:20] + ":/64" + ip = ":".join(ip.split(":")[:4]) + "::/64" return ip