mirror of
https://github.com/mikedilger/chorus.git
synced 2026-08-31 07:31:01 +00:00
Add 'Authorization' to all Access-Control-Allow-Headers headers
This commit is contained in:
parent
47f91ce3e2
commit
ad687598a0
@ -70,20 +70,20 @@ pub async fn serve_http(
|
||||
let response = match method {
|
||||
Method::OPTIONS => Response::builder()
|
||||
.header("Access-Control-Allow-Origin", "*")
|
||||
.header("Access-Control-Allow-Headers", "*")
|
||||
.header("Access-Control-Allow-Headers", "Authorization, *")
|
||||
.header("Access-Control-Allow-Methods", "*")
|
||||
.header("Allow", "OPTIONS, GET, HEAD, PUT, DELETE")
|
||||
.status(StatusCode::NO_CONTENT)
|
||||
.body(Empty::new().map_err(|e| e.into()).boxed())?,
|
||||
Method::HEAD => Response::builder()
|
||||
.header("Access-Control-Allow-Origin", "*")
|
||||
.header("Access-Control-Allow-Headers", "*")
|
||||
.header("Access-Control-Allow-Headers", "Authorization, *")
|
||||
.header("Access-Control-Allow-Methods", "*")
|
||||
.status(StatusCode::OK)
|
||||
.body(Empty::new().map_err(|e| e.into()).boxed())?,
|
||||
Method::GET => Response::builder()
|
||||
.header("Access-Control-Allow-Origin", "*")
|
||||
.header("Access-Control-Allow-Headers", "*")
|
||||
.header("Access-Control-Allow-Headers", "Authorization, *")
|
||||
.header("Access-Control-Allow-Methods", "*")
|
||||
.status(StatusCode::OK)
|
||||
.body(
|
||||
@ -93,7 +93,7 @@ pub async fn serve_http(
|
||||
)?,
|
||||
_ => Response::builder()
|
||||
.header("Access-Control-Allow-Origin", "*")
|
||||
.header("Access-Control-Allow-Headers", "*")
|
||||
.header("Access-Control-Allow-Headers", "Authorization, *")
|
||||
.header("Access-Control-Allow-Methods", "*")
|
||||
.status(StatusCode::METHOD_NOT_ALLOWED)
|
||||
.body(Empty::new().map_err(|e| e.into()).boxed())?,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user