Skip to content

Commit

Permalink
fix: patch the way CORS headers are done, without this, the server cr…
Browse files Browse the repository at this point in the history
…ashes on startup with an unhelpful error message (#14)
  • Loading branch information
sighphyre authored Jan 25, 2023
1 parent 5f55517 commit 71a9a23
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ async fn main() -> Result<(), anyhow::Error> {
let client_provider_data = web::Data::from(client_provider_arc);

let cors_middleware = Cors::default()
.allowed_origin("*")
.allow_any_origin()
.send_wildcard()
.allowed_methods(vec!["GET", "POST"])
.allowed_headers(vec![http::header::AUTHORIZATION, http::header::ACCEPT])
.allowed_header(http::header::CONTENT_TYPE);
Expand Down

0 comments on commit 71a9a23

Please sign in to comment.