mirror of
https://github.com/sigoden/dufs.git
synced 2026-04-09 00:59:02 +03:00
fix: login successed but popup Forbidden (#437)
This commit is contained in:
@@ -119,11 +119,11 @@ fn auth_check(
|
||||
#[with(&["--auth", "user:pass@/:rw", "--auth", "user2:pass2@/", "-A"])] server: TestServer,
|
||||
) -> Result<(), Error> {
|
||||
let url = format!("{}index.html", server.url());
|
||||
let resp = fetch!(b"WRITEABLE", &url).send()?;
|
||||
let resp = fetch!(b"AUTH", &url).send()?;
|
||||
assert_eq!(resp.status(), 401);
|
||||
let resp = send_with_digest_auth(fetch!(b"WRITEABLE", &url), "user2", "pass2")?;
|
||||
assert_eq!(resp.status(), 403);
|
||||
let resp = send_with_digest_auth(fetch!(b"WRITEABLE", &url), "user", "pass")?;
|
||||
let resp = send_with_digest_auth(fetch!(b"AUTH", &url), "user", "pass")?;
|
||||
assert_eq!(resp.status(), 200);
|
||||
let resp = send_with_digest_auth(fetch!(b"AUTH", &url), "user2", "pass2")?;
|
||||
assert_eq!(resp.status(), 200);
|
||||
Ok(())
|
||||
}
|
||||
@@ -133,11 +133,11 @@ fn auth_compact_rules(
|
||||
#[with(&["--auth", "user:pass@/:rw|user2:pass2@/", "-A"])] server: TestServer,
|
||||
) -> Result<(), Error> {
|
||||
let url = format!("{}index.html", server.url());
|
||||
let resp = fetch!(b"WRITEABLE", &url).send()?;
|
||||
let resp = fetch!(b"AUTH", &url).send()?;
|
||||
assert_eq!(resp.status(), 401);
|
||||
let resp = send_with_digest_auth(fetch!(b"WRITEABLE", &url), "user2", "pass2")?;
|
||||
assert_eq!(resp.status(), 403);
|
||||
let resp = send_with_digest_auth(fetch!(b"WRITEABLE", &url), "user", "pass")?;
|
||||
let resp = send_with_digest_auth(fetch!(b"AUTH", &url), "user", "pass")?;
|
||||
assert_eq!(resp.status(), 200);
|
||||
let resp = send_with_digest_auth(fetch!(b"AUTH", &url), "user2", "pass2")?;
|
||||
assert_eq!(resp.status(), 200);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user