From 9ce5b325dc70af19c401983aa4883f463a5b582b Mon Sep 17 00:00:00 2001 From: Kaung Myat Thu <2962000kaungmyatthu@gmail.com> Date: Tue, 14 Jan 2025 23:45:07 +0700 Subject: [PATCH] feat: allow cors --- src/http.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/http.rs b/src/http.rs index c31346d..bdf5a6d 100644 --- a/src/http.rs +++ b/src/http.rs @@ -178,6 +178,7 @@ pub async fn handle_request( set_http_header(&mut response_data, "Connection", "keep-alive"); set_http_header(&mut response_data, "Keep-Alive", format!("timeout={}", config.tcp_keepalive_time_sec).as_str()); + set_http_header(&mut response_data, "Access-Control-Allow-Origin", "*"); // Relay the collected response to the client if let Err(e) = client_stream.write_all(&response_data).await {