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

Fix possible AttributeError when account-api is called over unix socket #16404

Merged
merged 3 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading