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

Fixes #16396
This commit is contained in:
Christoph 2023-10-09 02:16:07 -07:00 committed by GitHub
parent 1f10c20806
commit 32fd9bc673
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

1
changelog.d/16404.bugfix Normal file
View File

@ -0,0 +1 @@
Fixes possbile `AttributeError` when `_matrix/client/v3/account/whoami` is called over a unix socket. Contributed by @Sir-Photch.

View File

@ -115,7 +115,7 @@ class InternalAuth(BaseAuth):
Once get_user_by_req has set up the opentracing span, this does the actual work. Once get_user_by_req has set up the opentracing span, this does the actual work.
""" """
try: try:
ip_addr = request.getClientAddress().host ip_addr = request.get_client_ip_if_available()
user_agent = get_request_user_agent(request) user_agent = get_request_user_agent(request)
access_token = self.get_access_token_from_request(request) access_token = self.get_access_token_from_request(request)