mirror of
https://github.com/servo/servo.git
synced 2025-08-17 11:25:35 +01:00
Auto merge of #16272 - nox:net, r=jdm
Net enhancements <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16272) <!-- Reviewable:end -->
This commit is contained in:
commit
bf7c044955
5 changed files with 51 additions and 57 deletions
|
@ -3,7 +3,6 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use net::hsts::{HstsEntry, HstsList};
|
||||
use net::hsts::secure_url;
|
||||
use net_traits::IncludeSubdomains;
|
||||
use std::collections::HashMap;
|
||||
use time;
|
||||
|
@ -294,27 +293,3 @@ fn test_preload_hsts_domains_well_formed() {
|
|||
let hsts_list = HstsList::from_servo_preload();
|
||||
assert!(!hsts_list.entries_map.is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_secure_url_does_not_change_explicit_port() {
|
||||
let url = Url::parse("http://mozilla.org:8080/").unwrap();
|
||||
let secure = secure_url(&url);
|
||||
|
||||
assert!(secure.port().unwrap() == 8080u16);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_secure_url_does_not_affect_non_http_schemas() {
|
||||
let url = Url::parse("file://mozilla.org").unwrap();
|
||||
let secure = secure_url(&url);
|
||||
|
||||
assert_eq!(secure.scheme(), "file");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_secure_url_forces_an_http_host_in_list_to_https() {
|
||||
let url = Url::parse("http://mozilla.org").unwrap();
|
||||
let secure = secure_url(&url);
|
||||
|
||||
assert_eq!(secure.scheme(), "https");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue