Update set of allowed characters in UserId localpart

This commit is contained in:
Jonas Platte 2019-12-09 17:43:15 +01:00
parent f84b7f2b7f
commit 7fa1407d76
No known key found for this signature in database
GPG Key ID: 7D261D771D915378

View File

@ -17,8 +17,10 @@ use url::Host;
use crate::{display, error::Error, generate_localpart, parse_id};
static USER_LOCALPART_PATTERN: Lazy<Regex> =
Lazy::new(|| Regex::new(r"\A[a-z0-9._=-]+\z").expect("Failed to create user localpart regex."));
// See https://matrix.org/docs/spec/appendices#user-identifiers
static USER_LOCALPART_PATTERN: Lazy<Regex> = Lazy::new(|| {
Regex::new(r"\A[a-z0-9\-.=_/]+\z").expect("Failed to create user localpart regex.")
});
/// A Matrix user ID.
///