diff --git a/src/api/client_server/room.rs b/src/api/client_server/room.rs index 4593b2e4..cb8930ec 100644 --- a/src/api/client_server/room.rs +++ b/src/api/client_server/room.rs @@ -900,20 +900,6 @@ async fn room_alias_check( ErrorKind::InvalidParam, "Room alias contained spaces which is not a valid room alias.", )); - } else if room_alias_name.len() > 255 { - // there is nothing spec-wise saying to check the limit of this, - // however absurdly long room aliases are guaranteed to be unreadable or done - // maliciously. there is no reason a room alias should even exceed 100 - // characters as is. generally in spec, 255 is matrix's fav number - return Err(Error::BadRequest( - ErrorKind::InvalidParam, - "Room alias is excessively long, clients may not be able to handle this. Please shorten it.", - )); - } else if room_alias_name.contains('"') { - return Err(Error::BadRequest( - ErrorKind::InvalidParam, - "Room alias contained `\"` which is not allowed.", - )); } // check if room alias is forbidden @@ -979,8 +965,6 @@ fn custom_room_id_check(custom_room_id: &String) -> Result { ErrorKind::InvalidParam, "Custom room ID contained spaces which is not valid.", )); - } else if custom_room_id.len() > 255 { - return Err(Error::BadRequest(ErrorKind::InvalidParam, "Custom room ID is too long.")); } let full_room_id = format!("!{}:{}", custom_room_id, services().globals.config.server_name);