From 7154b16dedd29f0188c3040816e0013198e3bf63 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Wed, 23 Nov 2022 17:40:02 +0100 Subject: add permissive CORS settings --- planetwars-server/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/planetwars-server/src/lib.rs b/planetwars-server/src/lib.rs index 2045eda..39dd57e 100644 --- a/planetwars-server/src/lib.rs +++ b/planetwars-server/src/lib.rs @@ -30,6 +30,7 @@ use axum::{ Router, }; use tower_http::compression::CompressionLayer; +use tower_http::cors::CorsLayer; type ConnectionPool = bb8::Pool>; @@ -153,6 +154,7 @@ pub fn create_pw_api(global_config: Arc, db_pool: DbPool) -> Route .layer(Extension(db_pool)) .layer(Extension(global_config)) .layer(CompressionLayer::new()) + .layer(CorsLayer::permissive()) } pub fn get_config() -> Result { -- cgit v1.2.3