From 3d78f758cdcc7c31df9f215d07e2629c8bbba1ac Mon Sep 17 00:00:00 2001 From: Xavier Vello Date: Tue, 14 Nov 2023 15:25:49 +0100 Subject: [PATCH] cors: allow every origin hostname, in case host header is rewritten --- capture/src/router.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/capture/src/router.rs b/capture/src/router.rs index bae787c..ff601d2 100644 --- a/capture/src/router.rs +++ b/capture/src/router.rs @@ -47,11 +47,7 @@ pub fn router< // Very permissive CORS policy, as old SDK versions // and reverse proxies might send funky headers. - let cors = CorsLayer::new() - .allow_methods([Method::GET, Method::POST, Method::OPTIONS]) - .allow_headers(AllowHeaders::mirror_request()) - .allow_credentials(true) - .allow_origin(AllowOrigin::mirror_request()); + let cors = CorsLayer::very_permissive(); let router = Router::new() // TODO: use NormalizePathLayer::trim_trailing_slash