summary refs log tree commit diff
path: root/synapse/handlers/directory.py
diff options
context:
space:
mode:
authorreivilibre <oliverw@matrix.org>2022-05-18 11:46:06 +0000
committerGitHub <noreply@github.com>2022-05-18 11:46:06 +0000
commitdf4963548b8f9bf9e36e76558864f7045d7b5215 (patch)
tree45858d017ca7facb80a998ba111840e6f23d6298 /synapse/handlers/directory.py
parentSwitch the 'Configuration' link in the docs homepage to the config manual (#1... (diff)
downloadsynapse-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.py3
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.