mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Inverts conditional and returns
This commit is contained in:
parent
1811ffa178
commit
d8acb893de
1 changed files with 23 additions and 19 deletions
|
@ -272,9 +272,11 @@ pub enum LoadError {
|
|||
}
|
||||
|
||||
fn set_default_accept_encoding(headers: &mut Headers) {
|
||||
if !headers.has::<AcceptEncoding>() {
|
||||
headers.set_raw("Accept-Encoding".to_owned(), vec![b"gzip, deflate".to_vec()]);
|
||||
if headers.has::<AcceptEncoding>() {
|
||||
return
|
||||
}
|
||||
|
||||
headers.set_raw("Accept-Encoding".to_owned(), vec![b"gzip, deflate".to_vec()]);
|
||||
}
|
||||
|
||||
fn set_default_accept(headers: &mut Headers) {
|
||||
|
@ -323,7 +325,10 @@ fn request_must_be_secured(url: &Url, resource_mgr_chan: &IpcSender<ControlMsg>)
|
|||
}
|
||||
|
||||
fn update_sts_list_from_response(url: &Url, response: &HttpResponse, resource_mgr_chan: &IpcSender<ControlMsg>) {
|
||||
if url.scheme == "https" {
|
||||
if url.scheme != "https" {
|
||||
return;
|
||||
}
|
||||
|
||||
if let Some(header) = response.headers().get::<StrictTransportSecurity>() {
|
||||
if let Some(host) = url.domain() {
|
||||
info!("adding host {} to the strict transport security list", host);
|
||||
|
@ -343,7 +348,6 @@ fn update_sts_list_from_response(url: &Url, response: &HttpResponse, resource_mg
|
|||
).unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct LoadResponse<R: HttpResponse> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue