summary refs log tree commit diff
path: root/synapse/http
diff options
context:
space:
mode:
authorDavid Baker <dbkr@users.noreply.github.com>2017-03-09 10:18:51 +0000
committerGitHub <noreply@github.com>2017-03-09 10:18:51 +0000
commit663396e45d680b090f74c79734114d55b97dfbf3 (patch)
treeb763e42527ce44ff83c5b4a28c2cbfe4cd396369 /synapse/http
parentRemove spurious SQL logging (#1972) (diff)
parentComment when our 3pids would be incomplete (diff)
downloadsynapse-663396e45d680b090f74c79734114d55b97dfbf3.tar.xz
Merge pull request #1971 from matrix-org/dbkr/msisdn_signin
Support registration & login with phone number
Diffstat (limited to 'synapse/http')
-rw-r--r--synapse/http/servlet.py10
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.