From 03922bbd086b998d77bed23afd33f760dd56932f Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Sat, 6 Jul 2024 06:24:13 -0500 Subject: [PATCH] adding narrower cors? --- src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 748dbff..c70884b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -49,8 +49,11 @@ async fn main() -> std::io::Result<()> { log::info!("starting HTTP server at http://localhost:4242"); HttpServer::new(|| { - let mut cors = Cors::default() - .allow_any_origin() + let cors = Cors::default() + .send_wildcard() + .allowed_origin("https://tfcconnection.org") + .allowed_origin("http://localhost:1313") + .allowed_origin("http://127.0.0.1:1313") .allow_any_method() .allow_any_header() .max_age(3600);