diff options
author | Pyfisch <pyfisch@gmail.com> | 2018-11-06 13:01:35 +0100 |
---|---|---|
committer | Pyfisch <pyfisch@gmail.com> | 2018-11-06 22:30:31 +0100 |
commit | cb07debcb6f3d3561177ce536c320986720791b7 (patch) | |
tree | ccac4d5a48b3112230f3fc2e873753dd7263e9fb /components/net/fetch/methods.rs | |
parent | bf47f90da667e95eaffc8fee36ca8a88e72e276c (diff) | |
download | servo-cb07debcb6f3d3561177ce536c320986720791b7.tar.gz servo-cb07debcb6f3d3561177ce536c320986720791b7.zip |
Format remaining files
Diffstat (limited to 'components/net/fetch/methods.rs')
-rw-r--r-- | components/net/fetch/methods.rs | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/components/net/fetch/methods.rs b/components/net/fetch/methods.rs index 0e744e0de26..a0ca76ff802 100644 --- a/components/net/fetch/methods.rs +++ b/components/net/fetch/methods.rs @@ -254,10 +254,11 @@ pub fn main_fetch( Response::network_error(NetworkError::Internal("Non-http scheme".into())) } else if request.use_cors_preflight || (request.unsafe_request && - (!is_cors_safelisted_method(&request.method) || - request.headers.iter().any(|(name, value)| { - !is_cors_safelisted_request_header(&name, &value) - }))) { + (!is_cors_safelisted_method(&request.method) || request + .headers + .iter() + .any(|(name, value)| !is_cors_safelisted_request_header(&name, &value)))) + { // Substep 1. request.response_tainting = ResponseTainting::CorsTainting; // Substep 2. @@ -372,11 +373,10 @@ pub fn main_fetch( // in the previous step. let not_network_error = !response_is_network_error && !internal_response.is_network_error(); if not_network_error && - (is_null_body_status(&internal_response.status) || - match request.method { - Method::HEAD | Method::CONNECT => true, - _ => false, - }) { + (is_null_body_status(&internal_response.status) || match request.method { + Method::HEAD | Method::CONNECT => true, + _ => false, + }) { // when Fetch is used only asynchronously, we will need to make sure // that nothing tries to write to the body at this point let mut body = internal_response.body.lock().unwrap(); @@ -791,13 +791,12 @@ fn should_be_blocked_due_to_mime_type( }; // Step 2-3 - destination.is_script_like() && - match mime_type.type_() { - mime::AUDIO | mime::VIDEO | mime::IMAGE => true, - mime::TEXT if mime_type.subtype() == mime::CSV => true, - // Step 4 - _ => false, - } + destination.is_script_like() && match mime_type.type_() { + mime::AUDIO | mime::VIDEO | mime::IMAGE => true, + mime::TEXT if mime_type.subtype() == mime::CSV => true, + // Step 4 + _ => false, + } } /// <https://fetch.spec.whatwg.org/#block-bad-port> |