feat: limited CORS headers

This commit is contained in:
Compositr 2024-11-02 18:14:34 +11:00
parent 4d82105da8
commit 8c7d34b5dd

View file

@ -44,6 +44,9 @@ fn send_response(mut stream: TcpStream, status: u16, body: Body) -> UnitOrBoxedE
// Headers
response.push_str("Server: luciders/0.1.0\r\n");
response.push_str("Cache-Control: immutable, public, max-age=604800\r\n");
// CORS
response.push_str("Access-Control-Allow-Origin: *\r\n");
response.push_str("Access-Control-Allow-Metods: GET\r\n");
response.push_str(&format!(
"Content-Length: {}\r\n",
match &body {