Fixed incorrect parsing of ipv6 addresses in RSGI and WSGI access logs (#477)

This commit is contained in:
Jordan Yelloz 2025-01-08 08:40:36 -07:00 committed by GitHub
parent a995402485
commit ceab635fc2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -107,7 +107,7 @@ def _build_access_logger(fmt):
logger(
t,
{
'addr_remote': scope.client.split(':')[0],
'addr_remote': scope.client.rsplit(':', 1)[0],
'protocol': 'HTTP/' + scope.http_version,
'path': scope.path,
'qs': scope.query_string,

View file

@ -80,7 +80,7 @@ def _build_access_logger(fmt):
logger(
t,
{
'addr_remote': scope['REMOTE_ADDR'].split(':')[0],
'addr_remote': scope['REMOTE_ADDR'].rsplit(':', 1)[0],
'protocol': scope['SERVER_PROTOCOL'],
'path': scope['PATH_INFO'],
'qs': scope['QUERY_STRING'],