diff --git a/components/net/fetch/methods.rs b/components/net/fetch/methods.rs index 7ffdc9b60ee..75a829c46d9 100644 --- a/components/net/fetch/methods.rs +++ b/components/net/fetch/methods.rs @@ -185,7 +185,7 @@ pub fn main_fetch(request: &mut Request, request.response_tainting = ResponseTainting::Basic; // Substep 2. - basic_fetch(request, cache, target, done_chan, context) + scheme_fetch(request, cache, target, done_chan, context) } else if request.mode == RequestMode::SameOrigin { Response::network_error(NetworkError::Internal("Cross-origin response".into())) @@ -195,7 +195,7 @@ pub fn main_fetch(request: &mut Request, request.response_tainting = ResponseTainting::Opaque; // Substep 2. - basic_fetch(request, cache, target, done_chan, context) + scheme_fetch(request, cache, target, done_chan, context) } else if !matches!(current_url.scheme(), "http" | "https") { Response::network_error(NetworkError::Internal("Non-http scheme".into())) @@ -397,7 +397,7 @@ fn wait_for_response(response: &Response, target: Target, done_chan: &mut DoneCh let body = response.body.lock().unwrap(); if let ResponseBody::Done(ref vec) = *body { // in case there was no channel to wait for, the body was - // obtained synchronously via basic_fetch for data/file/about/etc + // obtained synchronously via scheme_fetch for data/file/about/etc // We should still send the body across as a chunk target.process_response_chunk(vec.clone()); } else { @@ -406,8 +406,8 @@ fn wait_for_response(response: &Response, target: Target, done_chan: &mut DoneCh } } -/// [Basic fetch](https://fetch.spec.whatwg.org#basic-fetch) -fn basic_fetch(request: &mut Request, +/// [Scheme fetch](https://fetch.spec.whatwg.org#scheme-fetch) +fn scheme_fetch(request: &mut Request, cache: &mut CorsCache, target: Target, done_chan: &mut DoneChannel, diff --git a/components/net/websocket_loader.rs b/components/net/websocket_loader.rs index 71178bbc7d9..dc4253fb594 100644 --- a/components/net/websocket_loader.rs +++ b/components/net/websocket_loader.rs @@ -352,7 +352,7 @@ fn main_fetch(url: ServoUrl, // doesn't need to be filtered at all. // Step 12.2. - basic_fetch(&url, origin, &mut headers, http_state) + scheme_fetch(&url, origin, &mut headers, http_state) }); // Step 13. @@ -386,8 +386,8 @@ fn main_fetch(url: ServoUrl, response } -// https://fetch.spec.whatwg.org/#concept-basic-fetch -fn basic_fetch(url: &ServoUrl, +// https://fetch.spec.whatwg.org/#concept-scheme-fetch +fn scheme_fetch(url: &ServoUrl, origin: String, headers: &mut Headers, http_state: &HttpState)