Fix for peername tuple size variability in get_client_ip

This commit is contained in:
George Rolfe 2025-12-26 09:10:37 +11:00
parent b9def4cb6e
commit 6f32f95e79

View File

@ -55,9 +55,10 @@ def should_be_disabled(fullpath:str) -> bool:
def get_client_ip(request):
peername = request.transport.get_extra_info("peername")
if peername is not None:
host, port = peername
# Grab the first two values - there can be more, ie. with --listen
host, port = peername[:2]
return host
return "unknown"