Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the fetch target non-optional. #14465

Merged
merged 9 commits into from Dec 15, 2016
Prev

Stop returning the response from fetch().

  • Loading branch information
Ms2ger committed Dec 15, 2016
commit 1e0ab08c421b9cccbf07244ad5b37e5b95a60ead
@@ -44,16 +44,14 @@ pub type DoneChannel = Option<(Sender<Data>, Receiver<Data>)>;
/// [Fetch](https://fetch.spec.whatwg.org#concept-fetch)
pub fn fetch(request: Rc<Request>,
target: Target,
context: &FetchContext)
-> Response {
fetch_with_cors_cache(request, &mut CorsCache::new(), target, context)
context: &FetchContext) {
fetch_with_cors_cache(request, &mut CorsCache::new(), target, context);
}

pub fn fetch_with_cors_cache(request: Rc<Request>,
cache: &mut CorsCache,
target: Target,
context: &FetchContext)
-> Response {
context: &FetchContext) {
// Step 1
if request.window.get() == Window::Client {
// 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
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)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.