summaryrefslogtreecommitdiffstats
path: root/net/http/http_cache.cc
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-09 19:18:41 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-09 19:18:41 +0000
commitb7d05ab3d0cce2d74d24f702641b3f5702584dab (patch)
tree30511d93a0898c99dd4e4200a78acca34d67a45c /net/http/http_cache.cc
parent7de99596feecaa24900a082a721ef8d4f57b47ee (diff)
downloadchromium_src-b7d05ab3d0cce2d74d24f702641b3f5702584dab.zip
chromium_src-b7d05ab3d0cce2d74d24f702641b3f5702584dab.tar.gz
chromium_src-b7d05ab3d0cce2d74d24f702641b3f5702584dab.tar.bz2
If a server answers a cache validation request with 304 and cache-control:no-store,
we return the cached entry to the requestor but doom the entry so it's not used in the future. B=b/1363355 R=darin TEST=unit test. Review URL: http://codereview.chromium.org/13273 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6605 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_cache.cc')
-rw-r--r--net/http/http_cache.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc
index 3271035..b82795c 100644
--- a/net/http/http_cache.cc
+++ b/net/http/http_cache.cc
@@ -853,7 +853,11 @@ void HttpCache::Transaction::OnNetworkInfoAvailable(int result) {
if (new_response->headers->response_code() == 304) {
// Update cached response based on headers in new_response
response_.headers->Update(*new_response->headers);
- WriteResponseInfoToEntry();
+ if (response_.headers->HasHeaderValue("cache-control", "no-store")) {
+ cache_->DoomEntry(cache_key_);
+ } else {
+ WriteResponseInfoToEntry();
+ }
if (entry_) {
cache_->ConvertWriterToReader(entry_);