summary refs log tree commit diff
path: root/synapse/handlers/register.py
diff options
context:
space:
mode:
authorLuke Barnard <lukeb@openmarket.com>2017-05-10 17:17:12 +0100
committerLuke Barnard <lukeb@openmarket.com>2017-05-10 17:23:55 +0100
commit369195caa5f52fc67c2496507fc99fccf4b0ede8 (patch)
treed8fde3711eca7d3bf1bb5413322fe585a8ab0881 /synapse/handlers/register.py
parentMerge pull request #2208 from matrix-org/erikj/ratelimit_overrid (diff)
downloadsynapse-369195caa5f52fc67c2496507fc99fccf4b0ede8.tar.xz
Modify register/available to be GET with query param
- GET is now the method for register/available
- a query parameter "username" is now used

Also, empty usernames are now handled with an error message on registration or via register/available: `User ID cannot be empty`
Diffstat (limited to 'synapse/handlers/register.py')
-rw-r--r--synapse/handlers/register.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/handlers/register.py b/synapse/handlers/register.py
index 03c6a85fc6..dd84c5f5e9 100644
--- a/synapse/handlers/register.py
+++ b/synapse/handlers/register.py
@@ -54,6 +54,13 @@ class RegistrationHandler(BaseHandler):
                 Codes.INVALID_USERNAME
             )
 
+        if len(localpart) == 0:
+            raise SynapseError(
+                400,
+                "User ID cannot be empty",
+                Codes.INVALID_USERNAME
+            )
+
         if localpart[0] == '_':
             raise SynapseError(
                 400,