diff --git a/crates/cloud/src/utils.rs b/crates/cloud/src/utils.rs index df3371bb..86a7363b 100644 --- a/crates/cloud/src/utils.rs +++ b/crates/cloud/src/utils.rs @@ -96,7 +96,7 @@ fn is_valid_name(name: &str) -> bool { let min_len = 1; let char_count = name.chars().count(); lazy_static! { - static ref NAME_REGEX: Regex = Regex::new(r"^[\w\d_][\w\d_ \(\)\.,'\-]*$").unwrap(); + static ref NAME_REGEX: Regex = Regex::new(r"^[\w\d_][\w\d_ \(\)\.,'\-!]*$").unwrap(); } char_count >= min_len @@ -450,6 +450,11 @@ mod tests { assert!(!is_valid_name("hell")); } + #[actix_web::test] + async fn test_is_valid_name_bang() { + assert!(is_valid_name("hello!")); + } + #[actix_web::test] async fn test_get_unique_name() { let names = ["name", "name (2)", "name (3)", "name (4)"].into_iter();