summary refs log tree commit diff
path: root/synapse/http
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-12-06 10:43:48 +0000
committerErik Johnston <erik@matrix.org>2016-12-06 16:12:27 +0000
commitf32fb6555246adec537bfbca1ddca19e8fe5f4ba (patch)
tree1e275b7f28f35e8954144e4b1568a89ebb968192 /synapse/http
parentTravis config (#1674) (diff)
downloadsynapse-f32fb6555246adec537bfbca1ddca19e8fe5f4ba.tar.xz
Add new API appservice specific public room list
Diffstat (limited to 'synapse/http')
-rw-r--r--synapse/http/servlet.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/synapse/http/servlet.py b/synapse/http/servlet.py
index 9346386238..8c22d6f00f 100644
--- a/synapse/http/servlet.py
+++ b/synapse/http/servlet.py
@@ -78,12 +78,16 @@ def parse_boolean(request, name, default=None, required=False):
             parameter is present and not one of "true" or "false".
     """
 
-    if name in request.args:
+    return parse_boolean_from_args(request.args, name, default, required)
+
+
+def parse_boolean_from_args(args, name, default=None, required=False):
+    if name in args:
         try:
             return {
                 "true": True,
                 "false": False,
-            }[request.args[name][0]]
+            }[args[name][0]]
         except:
             message = (
                 "Boolean query parameter %r must be one of"