mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Upgrade to rust-url 1.0 and hyper 0.9
This commit is contained in:
parent
305c283602
commit
7932ab6ac2
76 changed files with 524 additions and 888 deletions
|
@ -122,13 +122,11 @@ impl HstsList {
|
|||
}
|
||||
|
||||
pub fn secure_url(url: &Url) -> Url {
|
||||
if &*url.scheme == "http" {
|
||||
if url.scheme() == "http" {
|
||||
let mut secure_url = url.clone();
|
||||
secure_url.scheme = "https".to_owned();
|
||||
secure_url.relative_scheme_data_mut()
|
||||
.map(|scheme_data| {
|
||||
scheme_data.default_port = Some(443);
|
||||
});
|
||||
secure_url.set_scheme("https").unwrap();
|
||||
// .set_port(Some(443)) would set the port to None,
|
||||
// and should only be done when it was already None.
|
||||
secure_url
|
||||
} else {
|
||||
url.clone()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue