summary refs log tree commit diff
path: root/synapse/api/auth.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2022-05-04 14:11:21 -0400
committerGitHub <noreply@github.com>2022-05-04 14:11:21 -0400
commit7fbf42499d92ec3c9a05d9f36ec5fecd1ab1f18c (patch)
tree5f3a08745f204376a211aa3ece6f92f4108a9891 /synapse/api/auth.py
parentImplement changes to MSC2285 (hidden read receipts) (#12168) (diff)
downloadsynapse-7fbf42499d92ec3c9a05d9f36ec5fecd1ab1f18c.tar.xz
Use `getClientAddress` instead of `getClientIP`. (#12599)
getClientIP was deprecated in Twisted 18.4.0, which also added
getClientAddress. The Synapse minimum version for Twisted is
currently 18.9.0, so all supported versions have the new API.
Diffstat (limited to 'synapse/api/auth.py')
-rw-r--r--synapse/api/auth.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index 01c32417d8..f6202ef7a5 100644
--- a/synapse/api/auth.py
+++ b/synapse/api/auth.py
@@ -187,7 +187,7 @@ class Auth:
         Once get_user_by_req has set up the opentracing span, this does the actual work.
         """
         try:
-            ip_addr = request.getClientIP()
+            ip_addr = request.getClientAddress().host
             user_agent = get_request_user_agent(request)
 
             access_token = self.get_access_token_from_request(request)
@@ -356,7 +356,7 @@ class Auth:
             return None, None, None
 
         if app_service.ip_range_whitelist:
-            ip_address = IPAddress(request.getClientIP())
+            ip_address = IPAddress(request.getClientAddress().host)
             if ip_address not in app_service.ip_range_whitelist:
                 return None, None, None