fix: cors allow-request-header add content-type (#184)

* fix: cors allow-request-header add content-type

* add content-type test
This commit is contained in:
horizon 2023-02-27 07:28:33 +08:00 committed by GitHub
parent 65da9bedee
commit 6dcb4dcd76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -1222,7 +1222,7 @@ fn add_cors(res: &mut Response) {
);
res.headers_mut().insert(
"Access-Control-Allow-Headers",
HeaderValue::from_static("Authorization,Destination,Range"),
HeaderValue::from_static("Authorization,Destination,Range,Content-Type"),
);
res.headers_mut().insert(
"Access-Control-Expose-Headers",

View File

@ -23,7 +23,7 @@ fn cors(#[with(&["--enable-cors"])] server: TestServer) -> Result<(), Error> {
);
assert_eq!(
resp.headers().get("access-control-allow-headers").unwrap(),
"Authorization,Destination,Range"
"Authorization,Destination,Range,Content-Type"
);
assert_eq!(
resp.headers().get("access-control-expose-headers").unwrap(),