diff options
author | reivilibre <oliverw@matrix.org> | 2022-05-18 11:46:06 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-18 11:46:06 +0000 |
commit | df4963548b8f9bf9e36e76558864f7045d7b5215 (patch) | |
tree | 45858d017ca7facb80a998ba111840e6f23d6298 /synapse/handlers/directory.py | |
parent | Switch the 'Configuration' link in the docs homepage to the config manual (#1... (diff) | |
download | synapse-df4963548b8f9bf9e36e76558864f7045d7b5215.tar.xz |
Give a meaningful error message when a client tries to create a room with an invalid alias localpart. (#12779)
Diffstat (limited to 'synapse/handlers/directory.py')
-rw-r--r-- | synapse/handlers/directory.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/handlers/directory.py b/synapse/handlers/directory.py index 33d827a45b..4aa33df884 100644 --- a/synapse/handlers/directory.py +++ b/synapse/handlers/directory.py @@ -71,6 +71,9 @@ class DirectoryHandler: if wchar in room_alias.localpart: raise SynapseError(400, "Invalid characters in room alias") + if ":" in room_alias.localpart: + raise SynapseError(400, "Invalid character in room alias localpart: ':'.") + if not self.hs.is_mine(room_alias): raise SynapseError(400, "Room alias must be local") # TODO(erikj): Change this. |