mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Introduce HstsList::switch_known_hsts_host_domain_url_to_https
This commit is contained in:
parent
170bcfc03e
commit
fb86bfebf4
3 changed files with 18 additions and 9 deletions
|
@ -163,15 +163,8 @@ pub fn main_fetch(request: &mut Request,
|
|||
// TODO: handle FTP URLs.
|
||||
|
||||
// Step 10.
|
||||
if !request.current_url().is_secure_scheme() && request.current_url().domain().is_some() {
|
||||
if context.state
|
||||
.hsts_list
|
||||
.read()
|
||||
.unwrap()
|
||||
.is_host_secure(request.current_url().domain().unwrap()) {
|
||||
request.url_list.last_mut().unwrap().as_mut_url().set_scheme("https").unwrap();
|
||||
}
|
||||
}
|
||||
context.state.hsts_list.read().unwrap().switch_known_hsts_host_domain_url_to_https(
|
||||
request.current_url_mut());
|
||||
|
||||
// Step 11.
|
||||
// Not applicable: see fetch_async.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue