mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
fix issues from review
Co-authored-by: Clément Renault <clement@meilisearch.com>
This commit is contained in:
parent
305665cd42
commit
b96da94f92
4 changed files with 7 additions and 6 deletions
|
@ -2,6 +2,7 @@
|
|||
/// This middleware normalizes slashes in paths
|
||||
/// * consecutive instances of `/` get collapsed into one `/`
|
||||
/// * any ending `/` is removed.
|
||||
/// Original source from: https://gitlab.com/snippets/1884466
|
||||
///
|
||||
/// Ex:
|
||||
/// /this///url/
|
||||
|
@ -69,7 +70,7 @@ where
|
|||
|
||||
let path = match parts.path_and_query.as_ref().map(|pq| pq.query()).flatten() {
|
||||
Some(q) => bytes::Bytes::from(format!("{}?{}", new_path, q)),
|
||||
None =>bytes::Bytes::from(format!("{}", new_path))
|
||||
None => bytes::Bytes::from(new_path.to_string()),
|
||||
};
|
||||
|
||||
if let Ok(pq) = PathAndQuery::from_maybe_shared(path) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue