diff --git a/src/server.rs b/src/server.rs index dc76d61..41b7e2e 100644 --- a/src/server.rs +++ b/src/server.rs @@ -497,7 +497,11 @@ impl Server { .get("q") .ok_or_else(|| anyhow!("invalid q"))? .to_lowercase(); - if !search.is_empty() { + if search.is_empty() { + return self + .handle_ls_dir(path, true, query_params, head_only, user, access_paths, res) + .await; + } else { let path_buf = path.to_path_buf(); let hidden = Arc::new(self.args.hidden.to_vec()); let hidden = hidden.clone(); diff --git a/tests/http.rs b/tests/http.rs index 9c0d464..fc6583d 100644 --- a/tests/http.rs +++ b/tests/http.rs @@ -147,9 +147,7 @@ fn head_dir_search(#[with(&["-A"])] server: TestServer) -> Result<(), Error> { #[rstest] fn empty_search(#[with(&["-A"])] server: TestServer) -> Result<(), Error> { let resp = reqwest::blocking::get(format!("{}?q=", server.url()))?; - assert_eq!(resp.status(), 200); - let paths = utils::retrieve_index_paths(&resp.text()?); - assert!(paths.is_empty()); + assert_resp_paths!(resp); Ok(()) }