From e5c4e44480266bad2510e83a21b8a09bab91719f Mon Sep 17 00:00:00 2001 From: Sir-Photch Date: Fri, 29 Sep 2023 18:51:56 -0700 Subject: [PATCH 1/3] switch to get_client_ip_if_available --- synapse/api/auth/internal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synapse/api/auth/internal.py b/synapse/api/auth/internal.py index a75f6f2cc44e..36ee9c8b8fc8 100644 --- a/synapse/api/auth/internal.py +++ b/synapse/api/auth/internal.py @@ -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) From 7801b807e40eefa4ab5886935cf997e34d8b3b30 Mon Sep 17 00:00:00 2001 From: Sir-Photch Date: Fri, 29 Sep 2023 19:02:08 -0700 Subject: [PATCH 2/3] changelog file --- changelog.d/16404.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/16404.bugfix diff --git a/changelog.d/16404.bugfix b/changelog.d/16404.bugfix new file mode 100644 index 000000000000..9ebacd26ebe2 --- /dev/null +++ b/changelog.d/16404.bugfix @@ -0,0 +1 @@ +Fixes possbile AttributeError when `_matrix/client/v3/account/whoami` is called over a unix socket From 010197bb7f36aaa244a659422e828c9ebf261cb7 Mon Sep 17 00:00:00 2001 From: Sir-Photch Date: Fri, 29 Sep 2023 19:03:38 -0700 Subject: [PATCH 3/3] changelog file --- changelog.d/16404.bugfix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/16404.bugfix b/changelog.d/16404.bugfix index 9ebacd26ebe2..3fd5028b33f9 100644 --- a/changelog.d/16404.bugfix +++ b/changelog.d/16404.bugfix @@ -1 +1 @@ -Fixes possbile AttributeError when `_matrix/client/v3/account/whoami` is called over a unix socket +Fixes possbile `AttributeError` when `_matrix/client/v3/account/whoami` is called over a unix socket. Contributed by @Sir-Photch.