From c819a69741f29cf7ab0a3b0e7336ffedde518ee1 Mon Sep 17 00:00:00 2001 From: clowzed Date: Wed, 8 Nov 2023 23:33:10 +0300 Subject: [PATCH] Add any for check if cors layer actually works --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 4389991..5f79faa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -68,6 +68,10 @@ async fn main() { .route("/", get(handlers::sites::index_redirect)) .layer( CorsLayer::new() + .allow_methods(AllowMethods::any()) + .allow_headers(AllowHeaders::any()) + .allow_origin(AllowOrigin::any()) + /* CorsLayer::new() .allow_methods(AllowMethods::list([Method::GET, Method::POST, Method::OPTIONS])) .allow_headers(AllowHeaders::list([HeaderName::from_static("x-subdomain")])) .allow_origin(AllowOrigin::predicate(move |origin, parts| { @@ -105,7 +109,7 @@ async fn main() { }); rx.recv().unwrap_or(false) - })), + })), */ ) .with_state(state.clone());