Stop returning the response from fetch().

This commit is contained in:
Ms2ger 2016-12-05 14:12:36 -10:00
parent 217f44b67a
commit 1e0ab08c42

View file

@ -44,16 +44,14 @@ pub type DoneChannel = Option<(Sender<Data>, Receiver<Data>)>;
/// [Fetch](https://fetch.spec.whatwg.org#concept-fetch) /// [Fetch](https://fetch.spec.whatwg.org#concept-fetch)
pub fn fetch(request: Rc<Request>, pub fn fetch(request: Rc<Request>,
target: Target, target: Target,
context: &FetchContext) context: &FetchContext) {
-> Response { fetch_with_cors_cache(request, &mut CorsCache::new(), target, context);
fetch_with_cors_cache(request, &mut CorsCache::new(), target, context)
} }
pub fn fetch_with_cors_cache(request: Rc<Request>, pub fn fetch_with_cors_cache(request: Rc<Request>,
cache: &mut CorsCache, cache: &mut CorsCache,
target: Target, target: Target,
context: &FetchContext) context: &FetchContext) {
-> Response {
// Step 1 // Step 1
if request.window.get() == Window::Client { if request.window.get() == Window::Client {
// TODO: Set window to request's client object if client is a Window object // TODO: Set window to request's client object if client is a Window object
@ -112,7 +110,7 @@ pub fn fetch_with_cors_cache(request: Rc<Request>,
} }
// Step 7 // Step 7
main_fetch(request, cache, false, false, target, &mut None, &context) main_fetch(request, cache, false, false, target, &mut None, &context);
} }
/// [Main fetch](https://fetch.spec.whatwg.org/#concept-main-fetch) /// [Main fetch](https://fetch.spec.whatwg.org/#concept-main-fetch)