summary refs log tree commit diff
path: root/synapse/http/servlet.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2016-12-12 17:00:10 +0000
committerGitHub <noreply@github.com>2016-12-12 17:00:10 +0000
commit1574b839e02a38434371d1cd97559102319cf206 (patch)
tree2dae67cf8872c2231d4f140b8517e37308a19f9f /synapse/http/servlet.py
parentMerge pull request #1694 from matrix-org/rav/no_get_e2e_keys (diff)
parentRename network_id to instance_id on client side (diff)
downloadsynapse-1574b839e02a38434371d1cd97559102319cf206.tar.xz
Merge pull request #1676 from matrix-org/erikj/room_list
Add new API appservice specific public room list
Diffstat (limited to 'synapse/http/servlet.py')
-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"