diff options
author | David Baker <dave@matrix.org> | 2017-03-13 17:27:51 +0000 |
---|---|---|
committer | David Baker <dave@matrix.org> | 2017-03-13 17:27:51 +0000 |
commit | 73a5f06652c6966eead46eded1d68f6f3522b54a (patch) | |
tree | c55477088549d6dceac827644a4340023c1f3adc /synapse/http/servlet.py | |
parent | Merge pull request #1990 from matrix-org/rav/log_config_comments (diff) | |
download | synapse-73a5f06652c6966eead46eded1d68f6f3522b54a.tar.xz |
Support registration / login with phone number
Changes from https://github.com/matrix-org/synapse/pull/1971
Diffstat (limited to 'synapse/http/servlet.py')
-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. |