From 96d4fd54bbd26193a2ec09e2fc5d7560289e2439 Mon Sep 17 00:00:00 2001 From: walter Date: Wed, 8 Jun 2022 19:58:47 -0400 Subject: [PATCH] Change the index uid format check for better legibility --- meilisearch-lib/src/index_resolver/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meilisearch-lib/src/index_resolver/mod.rs b/meilisearch-lib/src/index_resolver/mod.rs index 894eea9c5..12a5e007b 100644 --- a/meilisearch-lib/src/index_resolver/mod.rs +++ b/meilisearch-lib/src/index_resolver/mod.rs @@ -110,7 +110,8 @@ impl FromStr for IndexUid { if !uid .chars() .all(|x| x.is_ascii_alphanumeric() || x == '-' || x == '_') - || !(1..=400).contains(&uid.len()) + || uid.is_empty() + || uid.len() > 400 { Err(IndexUidFormatError { invalid_uid: uid.to_string(),