Skip to content
Snippets Groups Projects
Commit 57976f64 authored by Erik Johnston's avatar Erik Johnston
Browse files

Do more validation of incoming request

parent 8bad4070
No related branches found
No related tags found
No related merge requests found
......@@ -316,11 +316,11 @@ class RegisterRestServlet(ClientV1RestServlet):
def _do_shared_secret(self, request, register_json, session):
yield run_on_reactor()
if "mac" not in register_json:
if not isinstance(register_json.get("mac", None), basestring):
raise SynapseError(400, "Expected mac.")
if "user" not in register_json:
if not isinstance(register_json.get("user", None), basestring):
raise SynapseError(400, "Expected 'user' key.")
if "password" not in register_json:
if not isinstance(register_json.get("password", None), basestring):
raise SynapseError(400, "Expected 'password' key.")
if not self.hs.config.registration_shared_secret:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment