mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
parent
72d4433587
commit
855a9487ae
1 changed files with 11 additions and 0 deletions
|
@ -185,6 +185,17 @@ fn test_hsts_list_with_subdomain_when_host_is_exact_match_is_always_secure() {
|
||||||
assert!(hsts_list.always_secure("mozilla.org") == true);
|
assert!(hsts_list.always_secure("mozilla.org") == true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_make_hsts_secure_does_not_change_explicit_port() {
|
||||||
|
let load_data = LoadData::new(Url::parse("http://mozilla.org:8080/").unwrap(), None);
|
||||||
|
let hsts_list = HSTSList {
|
||||||
|
entries: vec![HSTSEntry { host: "mozilla.org".to_string(), include_subdomains: false}]
|
||||||
|
};
|
||||||
|
let secure_load_data = hsts_list.make_hsts_secure(load_data);
|
||||||
|
|
||||||
|
assert!(secure_load_data.url.port().unwrap() == 8080u16);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_make_hsts_secure_doesnt_affect_non_http_schemas() {
|
fn test_make_hsts_secure_doesnt_affect_non_http_schemas() {
|
||||||
let load_data = LoadData::new(Url::parse("file://mozilla.org").unwrap(), None);
|
let load_data = LoadData::new(Url::parse("file://mozilla.org").unwrap(), None);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue