From e7494beb34a0b695cb2deed8e7180727e7c7244b Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Wed, 8 Mar 2017 16:39:06 +0000 Subject: [PATCH] Also check for : --- .../matrix-org/dendrite/clientapi/writers/createroom.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/github.com/matrix-org/dendrite/clientapi/writers/createroom.go b/src/github.com/matrix-org/dendrite/clientapi/writers/createroom.go index edf2e7e15..a1da831b3 100644 --- a/src/github.com/matrix-org/dendrite/clientapi/writers/createroom.go +++ b/src/github.com/matrix-org/dendrite/clientapi/writers/createroom.go @@ -28,7 +28,8 @@ type createRoomRequest struct { func (r createRoomRequest) Validate() *util.JSONResponse { whitespace := "\t\n\x0b\x0c\r " // https://docs.python.org/2/library/string.html#string.whitespace // https://github.com/matrix-org/synapse/blob/v0.19.2/synapse/handlers/room.py#L81 - if strings.ContainsAny(r.RoomAliasName, whitespace) { + // Synapse doesn't check for ':' but we will else it will break parsers badly which split things into 2 segments. + if strings.ContainsAny(r.RoomAliasName, whitespace+":") { return &util.JSONResponse{ Code: 400, JSON: jsonerror.BadJSON("room_alias_name cannot contain whitespace"),