diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2021-01-12 12:48:12 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-12 12:48:12 +0000 |
commit | 0f8945e166b5f1965e69943e16c8220da74211bd (patch) | |
tree | 3c75a3d959cba800bd5e967c6c95e303483cabbd /synapse/api | |
parent | Remove SynapseRequest.get_user_agent (#9069) (diff) | |
download | synapse-0f8945e166b5f1965e69943e16c8220da74211bd.tar.xz |
Kill off `HomeServer.get_ip_from_request()` (#9080)
Homeserver.get_ip_from_request() used to be a bit more complicated, but now it is totally redundant. Let's get rid of it.
Diffstat (limited to 'synapse/api')
-rw-r--r-- | synapse/api/auth.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py index 6d6703250b..67ecbd32ff 100644 --- a/synapse/api/auth.py +++ b/synapse/api/auth.py @@ -187,7 +187,7 @@ class Auth: AuthError if access is denied for the user in the access token """ try: - ip_addr = self.hs.get_ip_from_request(request) + ip_addr = request.getClientIP() user_agent = get_request_user_agent(request) access_token = self.get_access_token_from_request(request) @@ -276,7 +276,7 @@ class Auth: return None, None if app_service.ip_range_whitelist: - ip_address = IPAddress(self.hs.get_ip_from_request(request)) + ip_address = IPAddress(request.getClientIP()) if ip_address not in app_service.ip_range_whitelist: return None, None |