Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Commit

Permalink
fix: added cors conf to allow content-type header
Browse files Browse the repository at this point in the history
  • Loading branch information
Rakowskiii committed Feb 8, 2023
1 parent 5af149d commit 3d30264
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use {
axum::routing::post,
axum::{http, routing::post},
mongodb::options::{ClientOptions, ResolverConfig},
opentelemetry::util::tokio_interval_stream,
rand::prelude::*,
Expand Down Expand Up @@ -138,7 +138,9 @@ pub async fn bootstap(mut shutdown: broadcast::Receiver<()>, config: Configurati

let global_middleware = ServiceBuilder::new();

let cors = CorsLayer::new().allow_origin(Any);
let cors = CorsLayer::new()
.allow_origin(Any)
.allow_headers([http::header::CONTENT_TYPE]);

let app = Router::new()
.route("/health", get(handlers::health::handler))
Expand Down

0 comments on commit 3d30264

Please sign in to comment.