summary refs log tree commit diff
path: root/synapse/handlers/register.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-08-02 17:07:54 +0100
committerErik Johnston <erik@matrix.org>2016-08-02 17:07:54 +0100
commit59a2c6d60e3c1e03f86e88ad81ac093c8109942d (patch)
treeef5a7b0722f1d2890df706ac6f42d6dda5986645 /synapse/handlers/register.py
parentTypo (diff)
parentMerge pull request #971 from matrix-org/erikj/fed_state (diff)
downloadsynapse-59a2c6d60e3c1e03f86e88ad81ac093c8109942d.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into release-v0.17.0
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 b9b5880d64..dd75c4fecf 100644
--- a/synapse/handlers/register.py
+++ b/synapse/handlers/register.py
@@ -53,6 +53,13 @@ class RegistrationHandler(BaseHandler):
                 Codes.INVALID_USERNAME
             )
 
+        if localpart[0] == '_':
+            raise SynapseError(
+                400,
+                "User ID may not begin with _",
+                Codes.INVALID_USERNAME
+            )
+
         user = UserID(localpart, self.hs.hostname)
         user_id = user.to_string()