Skip to content

Commit

Permalink
Fix search query parameter validation (#863)
Browse files Browse the repository at this point in the history
* Fix search query parameter validation

* fix compile

* make it actually work

---------

Co-authored-by: Geometrically <[email protected]>
  • Loading branch information
triphora and Geometrically authored Apr 22, 2024
1 parent 0a0837e commit 28b0d34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/search/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ pub async fn search_for_project(

let offset: usize = info.offset.as_deref().unwrap_or("0").parse()?;
let index = info.index.as_deref().unwrap_or("relevance");
let limit = info.limit.as_deref().unwrap_or("10").parse()?;
let limit = info.limit.as_deref().unwrap_or("10").parse::<usize>()?.min(100);

let sort = get_sort_index(config, index)?;
let meilisearch_index = client.get_index(sort.0).await?;
Expand Down

0 comments on commit 28b0d34

Please sign in to comment.