summary refs log tree commit diff
path: root/synapse/api
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2015-02-05 15:12:36 +0000
committerKegan Dougal <kegan@matrix.org>2015-02-05 15:12:36 +0000
commit5b99b471b2ba9a9c9da801e9a9d6e1801f02068c (patch)
tree282531f7d0aaaf0ff9ec4273f1093c63d0a19f1a /synapse/api
parentAdd CS extension for masquerading as users within the namespaces specified by... (diff)
downloadsynapse-5b99b471b2ba9a9c9da801e9a9d6e1801f02068c.tar.xz
Fix unit tests.
Diffstat (limited to 'synapse/api')
-rw-r--r--synapse/api/auth.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index 86f963c190..4f116184c9 100644
--- a/synapse/api/auth.py
+++ b/synapse/api/auth.py
@@ -302,6 +302,12 @@ class Auth(object):
 
             # Check for application service tokens with a user_id override
             try:
+                if "user_id" not in request.args:
+                    # This has to be done like this rather than relying on it
+                    # natively throwing because tests use a Mock for the request
+                    # object which doesn't throw :/
+                    raise KeyError
+
                 masquerade_user_id = request.args["user_id"][0]
                 app_service = yield self.store.get_app_service_by_token(
                     access_token