Adding a length check to query.

This commit is contained in:
Dessalines 2020-02-16 12:59:10 -05:00
parent aa1956e1b8
commit 60470b9449
1 changed files with 1 additions and 1 deletions

View File

@ -93,7 +93,7 @@ fn search_query(
) -> Result<Value, Error> { ) -> Result<Value, Error> {
let q = query.q.trim(); 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())); return Err(format_err!("{{\"error\": \"{}\"}}", "Empty query".to_string()));
} }