diff --git a/backend/src/macros.rs b/backend/src/macros.rs index eb329d9..9311965 100644 --- a/backend/src/macros.rs +++ b/backend/src/macros.rs @@ -1,5 +1,5 @@ use std::path::PathBuf; -use hyper::{Body, http, Response, StatusCode}; +use hyper::{Body, header, http, Response, StatusCode}; pub trait StringExt { fn resp(&self, status: u16) -> http::Result>; @@ -7,7 +7,8 @@ pub trait StringExt { impl StringExt for String { fn resp(&self, status: u16) -> http::Result> { - Response::builder().status(StatusCode::from_u16(status).unwrap()).body(Body::from(self.to_owned())) + Response::builder().header(header::ACCESS_CONTROL_ALLOW_ORIGIN, "*") + .status(StatusCode::from_u16(status).unwrap()).body(Body::from(self.to_owned())) } }