diff options
author | Paul Evans <leonerd@leonerd.org.uk> | 2016-07-29 14:10:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-29 14:10:45 +0100 |
commit | 18b7eb830b584398517ba84035c34ff90634f919 (patch) | |
tree | 504038d37d1102d2d0fc51adabf274060178ce61 /synapse | |
parent | Merge pull request #964 from matrix-org/erikj/fed_join_fix (diff) | |
parent | Forbid non-ASes from registering users whose names begin with '_' (SYN-738) (diff) | |
download | synapse-18b7eb830b584398517ba84035c34ff90634f919.tar.xz |
Merge pull request #958 from matrix-org/paul/SYN-738
Forbid non-ASes from registering users whose names begin with '_'
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/handlers/register.py | 7 |
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() |