Files
sigoden--dufs/tests/cors.rs
T
wehub-resource-sync 673f11c0c2
CI / All (ubuntu-latest) (push) Failing after 1s
CI / All (windows-latest) (push) Has been cancelled
CI / All (macos-latest) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:24:21 +08:00

34 lines
827 B
Rust

mod fixtures;
mod utils;
use fixtures::{server, Error, TestServer};
use rstest::rstest;
#[rstest]
fn cors(#[with(&["--enable-cors"])] server: TestServer) -> Result<(), Error> {
let resp = reqwest::blocking::get(server.url())?;
assert_eq!(
resp.headers().get("access-control-allow-origin").unwrap(),
"*"
);
assert_eq!(
resp.headers()
.get("access-control-allow-credentials")
.unwrap(),
"true"
);
assert_eq!(
resp.headers().get("access-control-allow-methods").unwrap(),
"*"
);
assert_eq!(
resp.headers().get("access-control-allow-headers").unwrap(),
"Authorization,*"
);
assert_eq!(
resp.headers().get("access-control-expose-headers").unwrap(),
"Authorization,*"
);
Ok(())
}