mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Rename basic fetch to scheme fetch
This commit is contained in:
parent
ed9c16575c
commit
b50bcdc8fc
2 changed files with 8 additions and 8 deletions
|
@ -185,7 +185,7 @@ pub fn main_fetch(request: &mut Request,
|
||||||
request.response_tainting = ResponseTainting::Basic;
|
request.response_tainting = ResponseTainting::Basic;
|
||||||
|
|
||||||
// Substep 2.
|
// Substep 2.
|
||||||
basic_fetch(request, cache, target, done_chan, context)
|
scheme_fetch(request, cache, target, done_chan, context)
|
||||||
|
|
||||||
} else if request.mode == RequestMode::SameOrigin {
|
} else if request.mode == RequestMode::SameOrigin {
|
||||||
Response::network_error(NetworkError::Internal("Cross-origin response".into()))
|
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;
|
request.response_tainting = ResponseTainting::Opaque;
|
||||||
|
|
||||||
// Substep 2.
|
// 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") {
|
} else if !matches!(current_url.scheme(), "http" | "https") {
|
||||||
Response::network_error(NetworkError::Internal("Non-http scheme".into()))
|
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();
|
let body = response.body.lock().unwrap();
|
||||||
if let ResponseBody::Done(ref vec) = *body {
|
if let ResponseBody::Done(ref vec) = *body {
|
||||||
// in case there was no channel to wait for, the body was
|
// 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
|
// We should still send the body across as a chunk
|
||||||
target.process_response_chunk(vec.clone());
|
target.process_response_chunk(vec.clone());
|
||||||
} else {
|
} 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)
|
/// [Scheme fetch](https://fetch.spec.whatwg.org#scheme-fetch)
|
||||||
fn basic_fetch(request: &mut Request,
|
fn scheme_fetch(request: &mut Request,
|
||||||
cache: &mut CorsCache,
|
cache: &mut CorsCache,
|
||||||
target: Target,
|
target: Target,
|
||||||
done_chan: &mut DoneChannel,
|
done_chan: &mut DoneChannel,
|
||||||
|
|
|
@ -352,7 +352,7 @@ fn main_fetch(url: ServoUrl,
|
||||||
// doesn't need to be filtered at all.
|
// doesn't need to be filtered at all.
|
||||||
|
|
||||||
// Step 12.2.
|
// Step 12.2.
|
||||||
basic_fetch(&url, origin, &mut headers, http_state)
|
scheme_fetch(&url, origin, &mut headers, http_state)
|
||||||
});
|
});
|
||||||
|
|
||||||
// Step 13.
|
// Step 13.
|
||||||
|
@ -386,8 +386,8 @@ fn main_fetch(url: ServoUrl,
|
||||||
response
|
response
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://fetch.spec.whatwg.org/#concept-basic-fetch
|
// https://fetch.spec.whatwg.org/#concept-scheme-fetch
|
||||||
fn basic_fetch(url: &ServoUrl,
|
fn scheme_fetch(url: &ServoUrl,
|
||||||
origin: String,
|
origin: String,
|
||||||
headers: &mut Headers,
|
headers: &mut Headers,
|
||||||
http_state: &HttpState)
|
http_state: &HttpState)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue