From 38dd87bd6ecd3615d978fc8abf255e9137c451ce Mon Sep 17 00:00:00 2001 From: clowzed Date: Wed, 8 Nov 2023 22:52:58 +0300 Subject: [PATCH] Add other methods to cors layer --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 357356e..4389991 100644 --- a/src/main.rs +++ b/src/main.rs @@ -68,7 +68,7 @@ async fn main() { .route("/", get(handlers::sites::index_redirect)) .layer( CorsLayer::new() - .allow_methods(AllowMethods::exact(Method::GET)) + .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| { let cloned_state = cloned_state.clone();