Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Fix possible AttributeError when account-api is called over unix sock…
Browse files Browse the repository at this point in the history
…et (#16404)

Fixes #16396
  • Loading branch information
Sir-Photch authored Oct 9, 2023
1 parent 1f10c20 commit 32fd9bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/16404.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixes possbile `AttributeError` when `_matrix/client/v3/account/whoami` is called over a unix socket. Contributed by @Sir-Photch.
2 changes: 1 addition & 1 deletion synapse/api/auth/internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ async def _wrapped_get_user_by_req(
Once get_user_by_req has set up the opentracing span, this does the actual work.
"""
try:
ip_addr = request.getClientAddress().host
ip_addr = request.get_client_ip_if_available()
user_agent = get_request_user_agent(request)

access_token = self.get_access_token_from_request(request)
Expand Down

0 comments on commit 32fd9bc

Please sign in to comment.