From d8a9058153a21e23d99aa4239a597a60674f0647 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Fri, 5 Jul 2024 21:08:23 -0500 Subject: [PATCH] add cors? --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index e467e7a..748dbff 100644 --- a/src/main.rs +++ b/src/main.rs @@ -49,7 +49,11 @@ async fn main() -> std::io::Result<()> { log::info!("starting HTTP server at http://localhost:4242"); HttpServer::new(|| { - let cors = Cors::permissive(); + let mut cors = Cors::default() + .allow_any_origin() + .allow_any_method() + .allow_any_header() + .max_age(3600); App::new() .wrap(middleware::Logger::default())