Skip to content

Commit 702ae43

Browse files
committed
bug: placeholders required alphanumeric only, now uses the entire ASCII.
1 parent 882c549 commit 702ae43

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

crates/placy-server/src/handlers.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,9 @@ pub(crate) fn parse_placeholders_from_request(
8989
let placeholder_key = key.trim().replace(' ', "_");
9090

9191
// Verify that it contains only alphabets and digits (and underscores from replacement)
92-
if !placeholder_key
93-
.chars()
94-
.all(|c| c.is_alphanumeric() || c == '_')
95-
{
92+
if !placeholder_key.is_ascii() {
9693
return Err(format!(
97-
"Invalid placeholder value for key '{}': must contain only letters, digits, and spaces",
94+
"Invalid placeholder value for key '{}': must contain only ASCII characters.",
9895
key_str
9996
));
10097
}

0 commit comments

Comments
 (0)