diff --git a/src/server/ctx/util.rs b/src/server/ctx/util.rs index 7ada1b6..7d77383 100644 --- a/src/server/ctx/util.rs +++ b/src/server/ctx/util.rs @@ -39,6 +39,9 @@ pub fn html_headers() -> HeaderMap { pub fn json_headers() -> HeaderMap { let mut headers = HeaderMap::new(); headers.insert(header::CONTENT_TYPE, "application/json".parse().unwrap()); + headers.insert(header::ACCESS_CONTROL_ALLOW_ORIGIN, "*".parse().unwrap()); + headers.insert(header::ACCESS_CONTROL_ALLOW_METHODS, "GET, POST, OPTIONS".parse().unwrap()); + headers.insert(header::ACCESS_CONTROL_ALLOW_HEADERS, "Content-Type".parse().unwrap()); headers }