jsonrpc security, cors headers, fixed #359

This commit is contained in:
debris
2016-02-22 13:41:38 +01:00
parent 38ccc24577
commit 90184658a7
4 changed files with 15 additions and 12 deletions

View File

@@ -23,8 +23,8 @@ impl HttpServer {
}
/// Start server asynchronously in new thread
pub fn start_async(self, addr: &str) {
pub fn start_async(self, addr: &str, cors_domain: &str) {
let server = jsonrpc_http_server::Server::new(self.handler, self.threads);
server.start_async(addr)
server.start_async(addr, jsonrpc_http_server::AccessControlAllowOrigin::Value(cors_domain.to_owned()))
}
}