fix ipv6 parsing
This commit is contained in:
parent
038b770706
commit
72ad0e9e7b
1 changed files with 1 additions and 1 deletions
2
main.py
2
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue