diff --git a/src/main.rs b/src/main.rs index 970d3a3..b4fa924 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,7 +9,7 @@ use dmds_tokio_fs::FsHandle; use paper::Paper; use question::Question; use serde::Deserialize; -use tower_http::cors::CorsLayer; +use tower_http::cors::{self, CorsLayer}; mod paper; mod question; @@ -106,7 +106,12 @@ async fn main() { &format!("/{}/{}", config.mng_secret, config.mng_reject_papers_secret), post(paper::reject::), ) - .layer(CorsLayer::very_permissive()) + .layer( + CorsLayer::new() + .allow_methods(cors::Any) + .allow_origin(cors::Any) + .allow_headers(cors::Any), + ) .with_state(state.clone()); tokio::spawn(dmds_tokio_fs::daemon(