mirror of
https://github.com/sigoden/dufs.git
synced 2026-04-09 00:59:02 +03:00
refactor: return 400 for propfind request when depth is neither 0 nor 1 (#403)
This commit is contained in:
@@ -40,6 +40,17 @@ fn propfind_dir_depth0(server: TestServer) -> Result<(), Error> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
fn propfind_dir_depth2(server: TestServer) -> Result<(), Error> {
|
||||
let resp = fetch!(b"PROPFIND", format!("{}dir1", server.url()))
|
||||
.header("depth", "2")
|
||||
.send()?;
|
||||
assert_eq!(resp.status(), 400);
|
||||
let body = resp.text()?;
|
||||
assert_eq!(body, "Invalid depth: only 0 and 1 are allowed.");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
fn propfind_404(server: TestServer) -> Result<(), Error> {
|
||||
let resp = fetch!(b"PROPFIND", format!("{}404", server.url())).send()?;
|
||||
|
||||
Reference in New Issue
Block a user