handle caching of response with a body of ResponseBody::Receiving

This commit is contained in:
Gregory Terzian 2017-11-26 21:31:26 +08:00
parent 609e975c50
commit 993e2f55ed
5 changed files with 80 additions and 43 deletions

View file

@ -408,6 +408,12 @@ pub fn main_fetch(request: &mut Request,
// Step 24.
target.process_response_eof(&response);
if !response.is_network_error() {
if let Ok(mut http_cache) = context.state.http_cache.write() {
http_cache.update_awaiting_consumers(&request, &response);
}
}
// Steps 25-27.
// TODO: remove this line when only asynchronous fetches are used
response