Skip to content

Commit

Permalink
Update HTTP-network fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
KiChjang committed Aug 18, 2017
1 parent 99f5935 commit 34178bd
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions components/net/http_loader.rs
Expand Up @@ -1024,8 +1024,6 @@ fn http_network_fetch(request: &Request,
done_chan: &mut DoneChannel,
context: &FetchContext)
-> Response {
// TODO: Implement HTTP network fetch spec

// Step 1
// nothing to do here, since credentials_flag is already a boolean

Expand All @@ -1036,6 +1034,9 @@ fn http_network_fetch(request: &Request,
// TODO be able to tell if the connection is a failure

// Step 4
// TODO: check whether the connection is HTTP/2

// Step 5
let url = request.current_url();

let request_id = context.devtools_chan.as_ref().map(|_| {
Expand Down Expand Up @@ -1150,10 +1151,10 @@ fn http_network_fetch(request: &Request,

// TODO Read request

// Step 5-9
// Step 6-11
// (needs stream bodies)

// Step 10
// Step 12
// TODO when https://bugzilla.mozilla.org/show_bug.cgi?id=1030660
// is resolved, this step will become uneccesary
// TODO this step
Expand All @@ -1165,24 +1166,22 @@ fn http_network_fetch(request: &Request,
}
};

// Step 11
// Step 13
// TODO this step isn't possible yet (CSP)

// Step 12
if response.is_network_error() && request.cache_mode == CacheMode::NoStore {
// Step 14
if !response.is_network_error() && request.cache_mode != CacheMode::NoStore {
// TODO update response in the HTTP cache for request
}

// TODO this step isn't possible yet
// Step 13

// Step 14.
// Step 15
if credentials_flag {
set_cookies_from_headers(&url, &response.headers, &context.state.cookie_jar);
}

// TODO these steps
// Step 15
// Step 16
// Substep 1
// Substep 2
// Sub-substep 1
Expand Down

0 comments on commit 34178bd

Please sign in to comment.