mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Pass a borrowed fetch context to fetch().
This will allow inspecting its state after fetching in unit tests.
This commit is contained in:
parent
1153ca9841
commit
234b47e33e
4 changed files with 8 additions and 8 deletions
|
@ -63,7 +63,7 @@ type DoneChannel = Option<(Sender<Data>, Receiver<Data>)>;
|
|||
/// [Fetch](https://fetch.spec.whatwg.org#concept-fetch)
|
||||
pub fn fetch<UI: 'static + UIProvider>(request: Rc<Request>,
|
||||
target: &mut Target,
|
||||
context: FetchContext<UI>)
|
||||
context: &FetchContext<UI>)
|
||||
-> Response {
|
||||
fetch_with_cors_cache(request, &mut CORSCache::new(), target, context)
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ pub fn fetch<UI: 'static + UIProvider>(request: Rc<Request>,
|
|||
pub fn fetch_with_cors_cache<UI: 'static + UIProvider>(request: Rc<Request>,
|
||||
cache: &mut CORSCache,
|
||||
target: &mut Target,
|
||||
context: FetchContext<UI>)
|
||||
context: &FetchContext<UI>)
|
||||
-> Response {
|
||||
// Step 1
|
||||
if request.window.get() == Window::Client {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue