From 591434778ff1ad6b2535e4b2447c35236d89195d Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Thu, 12 May 2022 11:36:57 +0200 Subject: [PATCH] Slightly simplify CORS example (#1027) --- examples/cors/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/cors/src/main.rs b/examples/cors/src/main.rs index e74258df..a8e02cc5 100644 --- a/examples/cors/src/main.rs +++ b/examples/cors/src/main.rs @@ -26,11 +26,11 @@ async fn main() { // for more details // // pay attention that for some request types like posting content-type: application/json - // it is required to add ".allow_headers(vec![http::header::CONTENT_TYPE])" + // it is required to add ".allow_headers([http::header::CONTENT_TYPE])" // or see this issue https://github.com/tokio-rs/axum/issues/849 CorsLayer::new() .allow_origin("http://localhost:3000".parse::().unwrap()) - .allow_methods(vec![Method::GET]), + .allow_methods([Method::GET]), ); serve(app, 4000).await; };