fix: auth not works with --path-prefix (#138)

close #137
This commit is contained in:
sigoden
2022-10-08 09:14:42 +08:00
committed by GitHub
parent 3b3ea718d9
commit dbf2de9cb9
2 changed files with 18 additions and 1 deletions

View File

@@ -121,3 +121,15 @@ fn auth_webdav_copy(
assert_eq!(resp.status(), 403);
Ok(())
}
#[rstest]
fn auth_path_prefix(
#[with(&["--auth", "/@user:pass", "--path-prefix", "xyz", "-A"])] server: TestServer,
) -> Result<(), Error> {
let url = format!("{}xyz/index.html", server.url());
let resp = fetch!(b"GET", &url).send()?;
assert_eq!(resp.status(), 401);
let resp = fetch!(b"GET", &url).send_with_digest_auth("user", "pass")?;
assert_eq!(resp.status(), 200);
Ok(())
}