mirror of
https://github.com/tiffany352/rink-rs
synced 2024-09-20 22:21:57 +00:00
Allow cross-origin requests to the web API
This commit is contained in:
parent
fb56fb9ecd
commit
56b990e968
1 changed files with 1 additions and 0 deletions
|
@ -32,6 +32,7 @@ fn main() {
|
|||
use url::form_urlencoded;
|
||||
|
||||
let req = move |mut req: Request, mut res: Response| {
|
||||
res.headers_mut().set::<header::AccessControlAllowOrigin>(header::AccessControlAllowOrigin::Any);
|
||||
match req.method {
|
||||
hyper::Get => {
|
||||
write!(res.start().unwrap(), "{}", TEMPLATE).unwrap();
|
||||
|
|
Loading…
Reference in a new issue