jsonrpc security, cors headers, fixed #359
This commit is contained in:
@@ -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" }
|
||||
|
||||
@@ -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()))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user