mirror of
https://github.com/sigoden/dufs.git
synced 2026-04-09 00:59:02 +03:00
feat: API to search and list directories (#177)
use `?simple` to output path name only. use `?json` to output paths in json format. By default, output html page. close #166
This commit is contained in:
@@ -21,11 +21,11 @@ fn single_file(tmpdir: TempDir, port: u16, #[case] file: &str) -> Result<(), Err
|
||||
|
||||
wait_for_port(port);
|
||||
|
||||
let resp = reqwest::blocking::get(format!("http://localhost:{}", port))?;
|
||||
let resp = reqwest::blocking::get(format!("http://localhost:{port}"))?;
|
||||
assert_eq!(resp.text()?, "This is index.html");
|
||||
let resp = reqwest::blocking::get(format!("http://localhost:{}/", port))?;
|
||||
let resp = reqwest::blocking::get(format!("http://localhost:{port}/"))?;
|
||||
assert_eq!(resp.text()?, "This is index.html");
|
||||
let resp = reqwest::blocking::get(format!("http://localhost:{}/index.html", port))?;
|
||||
let resp = reqwest::blocking::get(format!("http://localhost:{port}/index.html"))?;
|
||||
assert_eq!(resp.text()?, "This is index.html");
|
||||
|
||||
child.kill()?;
|
||||
@@ -46,13 +46,13 @@ fn path_prefix_single_file(tmpdir: TempDir, port: u16, #[case] file: &str) -> Re
|
||||
|
||||
wait_for_port(port);
|
||||
|
||||
let resp = reqwest::blocking::get(format!("http://localhost:{}/xyz", port))?;
|
||||
let resp = reqwest::blocking::get(format!("http://localhost:{port}/xyz"))?;
|
||||
assert_eq!(resp.text()?, "This is index.html");
|
||||
let resp = reqwest::blocking::get(format!("http://localhost:{}/xyz/", port))?;
|
||||
let resp = reqwest::blocking::get(format!("http://localhost:{port}/xyz/"))?;
|
||||
assert_eq!(resp.text()?, "This is index.html");
|
||||
let resp = reqwest::blocking::get(format!("http://localhost:{}/xyz/index.html", port))?;
|
||||
let resp = reqwest::blocking::get(format!("http://localhost:{port}/xyz/index.html"))?;
|
||||
assert_eq!(resp.text()?, "This is index.html");
|
||||
let resp = reqwest::blocking::get(format!("http://localhost:{}", port))?;
|
||||
let resp = reqwest::blocking::get(format!("http://localhost:{port}"))?;
|
||||
assert_eq!(resp.status(), 404);
|
||||
|
||||
child.kill()?;
|
||||
|
||||
Reference in New Issue
Block a user