From 60470b9449f0af15f50024c9181f42963b950b1b Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sun, 16 Feb 2020 12:59:10 -0500 Subject: [PATCH] Adding a length check to query. --- server/service/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/service/src/main.rs b/server/service/src/main.rs index 6d26a13..9764af0 100644 --- a/server/service/src/main.rs +++ b/server/service/src/main.rs @@ -93,7 +93,7 @@ fn search_query( ) -> Result { let q = query.q.trim(); - if q.is_empty() || q == "*" { + if q.is_empty() || q.len() <= 3 { return Err(format_err!("{{\"error\": \"{}\"}}", "Empty query".to_string())); }