summary refs log tree commit diff
path: root/synapse/handlers/auth.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2020-10-23 17:12:59 +0100
committerGitHub <noreply@github.com>2020-10-23 17:12:59 +0100
commitc850dd9a8e4e4f78fbe0b44686f3824b901236f6 (patch)
tree6ba78d1e55160a9f0cd70a40c88f6100abc00b5a /synapse/handlers/auth.py
parentFix email notifications for invites without local state. (#8627) (diff)
downloadsynapse-c850dd9a8e4e4f78fbe0b44686f3824b901236f6.tar.xz
Fix handling of User-Agent headers with bad utf-8. (#8632)
Diffstat (limited to 'synapse/handlers/auth.py')
-rw-r--r--synapse/handlers/auth.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/synapse/handlers/auth.py b/synapse/handlers/auth.py
index 8619fbb982..48d60feaab 100644
--- a/synapse/handlers/auth.py
+++ b/synapse/handlers/auth.py
@@ -470,9 +470,7 @@ class AuthHandler(BaseHandler):
             # authentication flow.
             await self.store.set_ui_auth_clientdict(sid, clientdict)
 
-        user_agent = request.requestHeaders.getRawHeaders(b"User-Agent", default=[b""])[
-            0
-        ].decode("ascii", "surrogateescape")
+        user_agent = request.get_user_agent("")
 
         await self.store.add_user_agent_ip_to_ui_auth_session(
             session.session_id, user_agent, clientip