aboutsummaryrefslogtreecommitdiffstats
path: root/components/net/fetch
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-04-05 09:27:55 -0500
committerGitHub <noreply@github.com>2017-04-05 09:27:55 -0500
commitbf7c044955ecfb8e074699e278994a08c22109fa (patch)
treecdb83b443b507c7cc89c7742ec7637a3aeb525ae /components/net/fetch
parentc12b17d276df5e6960358b33b9c9ff2fc414e083 (diff)
parente6cc88e5a2f7cc9a149e12145aae7912f071bc36 (diff)
downloadservo-bf7c044955ecfb8e074699e278994a08c22109fa.tar.gz
servo-bf7c044955ecfb8e074699e278994a08c22109fa.zip
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 -->
Diffstat (limited to 'components/net/fetch')
-rw-r--r--components/net/fetch/methods.rs16
1 files changed, 2 insertions, 14 deletions
diff --git a/components/net/fetch/methods.rs b/components/net/fetch/methods.rs
index 553c92cf79d..49fd0563297 100644
--- a/components/net/fetch/methods.rs
+++ b/components/net/fetch/methods.rs
@@ -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.
@@ -497,11 +490,6 @@ pub fn is_simple_method(m: &Method) -> bool {
}
}
-// fn modify_request_headers(headers: &mut Headers) -> {
-// // TODO this function
-
-// }
-
fn is_null_body_status(status: &Option<StatusCode>) -> bool {
match *status {
Some(status) => match status {