Pass a borrowed fetch context to fetch().

This will allow inspecting its state after fetching in unit tests.
This commit is contained in:
Ms2ger 2016-11-08 18:01:23 +01:00
parent 1153ca9841
commit 234b47e33e
4 changed files with 8 additions and 8 deletions

View file

@ -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 {