Bump JSON-RPC (#10151)

* Bump JSON-RPC

* Fix test casing.
This commit is contained in:
Tomasz Drwięga
2019-01-11 16:55:03 +01:00
committed by Niklas Adolfsson
parent 83f706186f
commit 83ba9df85b
3 changed files with 37 additions and 25 deletions

View File

@@ -75,7 +75,7 @@ mod testing {
);
// then
assert_eq!(response.status, "HTTP/1.1 200 Ok".to_owned());
assert_eq!(response.status, "HTTP/1.1 200 OK".to_owned());
}
#[test]

View File

@@ -98,17 +98,16 @@ impl ws::RequestMiddleware for WsExtractor {
fn process(&self, req: &ws::ws::Request) -> ws::MiddlewareAction {
use self::ws::ws::Response;
// Reply with 200 Ok to HEAD requests.
// Reply with 200 OK to HEAD requests.
if req.method() == "HEAD" {
let mut response = Response::new(200, "Ok");
let mut response = Response::new(200, "OK", vec![]);
add_security_headers(&mut response);
return Some(response).into();
}
// Display WS info.
if req.header("sec-websocket-key").is_none() {
let mut response = Response::new(200, "Ok");
response.set_body("WebSocket interface is active. Open WS connection to access RPC.");
let mut response = Response::new(200, "OK", b"WebSocket interface is active. Open WS connection to access RPC.".to_vec());
add_security_headers(&mut response);
return Some(response).into();
}
@@ -123,7 +122,7 @@ impl ws::RequestMiddleware for WsExtractor {
"Blocked connection from {} using invalid token.",
req.header("origin").and_then(|e| ::std::str::from_utf8(e).ok()).unwrap_or("Unknown Origin")
);
let mut response = Response::new(403, "Forbidden");
let mut response = Response::new(403, "Forbidden", vec![]);
add_security_headers(&mut response);
return Some(response).into();
}