Splitting RPC Apis into more fine-grained sets (#1234)

This commit is contained in:
Tomasz Drwięga
2016-06-07 22:52:48 +02:00
committed by Gav Wood
parent 13968aaa38
commit be435cde99
11 changed files with 195 additions and 103 deletions

View File

@@ -77,7 +77,7 @@ impl ws::Handler for Session {
// Check request origin and host header.
if !origin_is_allowed(&self.self_origin, origin) && !origin_is_allowed(&self.self_origin, host) {
warn!(target: "signer", "Blocked connection to Signer API from untrusted origin.");
return Ok(ws::Response::forbidden("You are not allowed to access system ui.".into()));
return Ok(ws::Response::forbidden(format!("You are not allowed to access system ui. Use: http://{}", self.self_origin)));
}
// Detect if it's a websocket request.
@@ -108,7 +108,7 @@ impl ws::Handler for Session {
let mut res = ws::Response::ok(f.content.into());
{
let mut headers = res.headers_mut();
headers.push(("Server".into(), b"Parity/SystemUI".to_vec()));
headers.push(("Server".into(), b"Parity/SignerUI".to_vec()));
headers.push(("Connection".into(), b"Closed".to_vec()));
headers.push(("Content-Length".into(), content_len.as_bytes().to_vec()));
headers.push(("Content-Type".into(), f.mime.as_bytes().to_vec()));