fix: no authentication check if no auth users

This commit is contained in:
sigoden
2024-12-11 08:57:30 +08:00
parent bc6c573acb
commit ab4ef06cb8
2 changed files with 13 additions and 0 deletions

View File

@@ -115,6 +115,16 @@ fn auth_skip_on_options_method(
Ok(())
}
#[rstest]
fn auth_skip_if_no_auth_user(server: TestServer) -> Result<(), Error> {
let url = format!("{}index.html", server.url());
let resp = fetch!(b"GET", &url)
.basic_auth("user", Some("pass"))
.send()?;
assert_eq!(resp.status(), 200);
Ok(())
}
#[rstest]
fn auth_check(
#[with(&["--auth", "user:pass@/:rw", "--auth", "user2:pass2@/", "-A"])] server: TestServer,