Merge pull request #493 from ethcore/jsonrpc_security

jsonrpc security, cors headers, fixed #359
This commit is contained in:
Marek Kotewicz
2016-02-25 14:08:18 +01:00
4 changed files with 15 additions and 12 deletions

View File

@@ -12,7 +12,7 @@ build = "build.rs"
serde = "0.6.7"
serde_json = "0.6.0"
jsonrpc-core = "1.1"
jsonrpc-http-server = "1.1"
jsonrpc-http-server = "2.0"
ethcore-util = { path = "../util" }
ethcore = { path = "../ethcore" }
ethsync = { path = "../sync" }

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()))
}
}