Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(612)

Unified Diff: net/http/http_cache_transaction.cc

Issue 976373005: Http Cache: Update vary data after a 304. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/http/http_cache_unittest.cc » ('j') | net/http/http_cache_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_cache_transaction.cc
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc
index 18ee59b1be04e78c31dc41e56768f4fe8d8b7a8c..7f012525e5192fd2a3a3b9bf62bcff1c2595d829 100644
--- a/net/http/http_cache_transaction.cc
+++ b/net/http/http_cache_transaction.cc
@@ -1665,6 +1665,15 @@ int HttpCache::Transaction::DoUpdateCachedResponse() {
response_.request_time = new_response_->request_time;
response_.network_accessed = new_response_->network_accessed;
response_.unused_since_prefetch = new_response_->unused_since_prefetch;
+ if (new_response_->vary_data.is_valid()) {
+ response_.vary_data = new_response_->vary_data;
+ } else if (response_.vary_data.is_valid()) {
+ // There is a vary header in the stored response but not in the current one.
+ // Update the data with the new request headers.
+ HttpVaryData new_vary_data;
+ new_vary_data.Init(*request_, *response_.headers.get());
+ response_.vary_data = new_vary_data;
+ }
if (response_.headers->HasHeaderValue("cache-control", "no-store")) {
if (!entry_->doomed) {
« no previous file with comments | « no previous file | net/http/http_cache_unittest.cc » ('j') | net/http/http_cache_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698