mirror of
https://github.com/tiffany352/rink-rs
synced 2024-11-10 21:54:15 +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;
|
use url::form_urlencoded;
|
||||||
|
|
||||||
let req = move |mut req: Request, mut res: Response| {
|
let req = move |mut req: Request, mut res: Response| {
|
||||||
|
res.headers_mut().set::<header::AccessControlAllowOrigin>(header::AccessControlAllowOrigin::Any);
|
||||||
match req.method {
|
match req.method {
|
||||||
hyper::Get => {
|
hyper::Get => {
|
||||||
write!(res.start().unwrap(), "{}", TEMPLATE).unwrap();
|
write!(res.start().unwrap(), "{}", TEMPLATE).unwrap();
|
||||||
|
|
Loading…
Reference in a new issue