fix: decodeURI searching string (#61)

This commit is contained in:
sigoden
2022-06-20 21:51:41 +08:00
committed by GitHub
parent c85ea06785
commit 069cb64889
2 changed files with 14 additions and 1 deletions

View File

@@ -153,7 +153,8 @@ impl Server {
} else if query == "zip" {
self.handle_zip_dir(path, head_only, &mut res).await?;
} else if let Some(q) = query.strip_prefix("q=") {
self.handle_query_dir(path, q, head_only, &mut res).await?;
let q = decode_uri(q).unwrap_or_default();
self.handle_query_dir(path, &q, head_only, &mut res).await?;
} else {
self.handle_ls_dir(path, true, head_only, &mut res).await?;
}