diff options
author | Erik Johnston <erikj@jki.re> | 2017-03-15 09:59:54 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-15 09:59:54 +0000 |
commit | 7827251daf0af9dbb1156819c6673e0fe6047181 (patch) | |
tree | 756500fb5640933185b85bd71c5a04063f709e48 /synapse/http | |
parent | Merge pull request #1992 from matrix-org/rav/fix_media_loop (diff) | |
parent | Use extend instead of += (diff) | |
download | synapse-7827251daf0af9dbb1156819c6673e0fe6047181.tar.xz |
Merge pull request #1994 from matrix-org/dbkr/msisdn_signin_2
Phone number registration / login support v2
Diffstat (limited to 'synapse/http')
-rw-r--r-- | synapse/http/servlet.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/synapse/http/servlet.py b/synapse/http/servlet.py index 8c22d6f00f..9a4c36ad5d 100644 --- a/synapse/http/servlet.py +++ b/synapse/http/servlet.py @@ -192,6 +192,16 @@ def parse_json_object_from_request(request): return content +def assert_params_in_request(body, required): + absent = [] + for k in required: + if k not in body: + absent.append(k) + + if len(absent) > 0: + raise SynapseError(400, "Missing params: %r" % absent, Codes.MISSING_PARAM) + + class RestServlet(object): """ A Synapse REST Servlet. |