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.
This commit is contained in:
Richard van der Hoff 2021-01-12 12:48:12 +00:00 committed by GitHub
parent 2ec8ca5e60
commit 0f8945e166
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 15 additions and 52 deletions

View file

@ -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