Skip to content

Commit

Permalink
Fixed incorrect parsing of ipv6 addresses in RSGI and WSGI access logs (
Browse files Browse the repository at this point in the history
  • Loading branch information
jyelloz authored Jan 8, 2025
1 parent a995402 commit ceab635
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion granian/rsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def access_log(t, scope, resp_code):
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,
Expand Down
2 changes: 1 addition & 1 deletion granian/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def access_log(t, scope, resp_code):
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'],
Expand Down

0 comments on commit ceab635

Please sign in to comment.