Missing changes required to make new UI work (#2793)
* Getting rid of old dapps * Updating proxypac and allowing home.parity on signer * CORS support for API * Fixing CORS - origin is sent with protocol * Fixing signer with proxy * Fixing grumbles * Fix expect msg [ci:skip]
This commit is contained in:
@@ -81,7 +81,28 @@ fn should_reject_invalid_host() {
|
||||
// then
|
||||
assert_eq!(response.status, "HTTP/1.1 403 FORBIDDEN".to_owned());
|
||||
assert!(response.body.contains("URL Blocked"));
|
||||
http_client::assert_security_headers_present(&response.headers);
|
||||
http_client::assert_security_headers_present(&response.headers, None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn should_allow_home_parity_host() {
|
||||
// given
|
||||
let server = serve().0;
|
||||
|
||||
// when
|
||||
let response = request(server,
|
||||
"\
|
||||
GET http://home.parity/ HTTP/1.1\r\n\
|
||||
Host: home.parity\r\n\
|
||||
Connection: close\r\n\
|
||||
\r\n\
|
||||
{}
|
||||
"
|
||||
);
|
||||
|
||||
// then
|
||||
assert_eq!(response.status, "HTTP/1.1 200 OK".to_owned());
|
||||
http_client::assert_security_headers_present(&response.headers, None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -102,7 +123,27 @@ fn should_serve_styles_even_on_disallowed_domain() {
|
||||
|
||||
// then
|
||||
assert_eq!(response.status, "HTTP/1.1 200 OK".to_owned());
|
||||
http_client::assert_security_headers_present(&response.headers);
|
||||
http_client::assert_security_headers_present(&response.headers, None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn should_return_200_ok_for_connect_requests() {
|
||||
// given
|
||||
let server = serve().0;
|
||||
|
||||
// when
|
||||
let response = request(server,
|
||||
"\
|
||||
CONNECT home.parity:8080 HTTP/1.1\r\n\
|
||||
Host: home.parity\r\n\
|
||||
Connection: close\r\n\
|
||||
\r\n\
|
||||
{}
|
||||
"
|
||||
);
|
||||
|
||||
// then
|
||||
assert_eq!(response.status, "HTTP/1.1 200 OK".to_owned());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -126,7 +167,7 @@ fn should_block_if_authorization_is_incorrect() {
|
||||
|
||||
// then
|
||||
assert_eq!(response.status, "HTTP/1.1 403 FORBIDDEN".to_owned());
|
||||
http_client::assert_security_headers_present(&response.headers);
|
||||
http_client::assert_security_headers_present(&response.headers, None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -205,5 +246,6 @@ fn should_allow_initial_connection_but_only_once() {
|
||||
// then
|
||||
assert_eq!(response1.status, "HTTP/1.1 101 Switching Protocols".to_owned());
|
||||
assert_eq!(response2.status, "HTTP/1.1 403 FORBIDDEN".to_owned());
|
||||
http_client::assert_security_headers_present(&response2.headers);
|
||||
http_client::assert_security_headers_present(&response2.headers, None);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user