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:
parent
65da9bedee
commit
6dcb4dcd76
2 changed files with 2 additions and 2 deletions
|
@ -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",
|
||||
|
|
|
@ -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(),
|
||||
|
|
Loading…
Reference in a new issue