Web wallet api updates (#1155)

* CORS for webwallet

* rustfmt

* automatically start up wallet web api (owner) listener
This commit is contained in:
Yeastplume
2018-06-11 18:19:38 +01:00
committed by GitHub
parent 973d46e6aa
commit 05073c5c02
5 changed files with 38 additions and 5 deletions
+6 -1
View File
@@ -202,7 +202,12 @@ where
IronError::new(Fail::compat(e), status::BadRequest)
})?;
let mut api = APIOwner::new(&mut *wallet);
let resp_json = self.handle_request(req, &mut api);
let mut resp_json = self.handle_request(req, &mut api);
resp_json
.as_mut()
.unwrap()
.headers
.set_raw("access-control-allow-origin", vec![b"*".to_vec()]);
api.wallet
.close()
.map_err(|e| IronError::new(Fail::compat(e), status::BadRequest))?;