aboutsummaryrefslogtreecommitdiffstats
path: root/components/net/fetch/methods.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/net/fetch/methods.rs')
-rw-r--r--components/net/fetch/methods.rs31
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>