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

Unified Diff: net/http/http_cache.cc

Issue 177016: Http cache: Bypass the cache for range requests that have validation headers.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 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') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_cache.cc
===================================================================
--- net/http/http_cache.cc (revision 24666)
+++ net/http/http_cache.cc (working copy)
@@ -81,6 +81,7 @@
static const HeaderNameAndValue kPassThroughHeaders[] = {
{ "if-unmodified-since", NULL }, // causes unexpected 412s
{ "if-match", NULL }, // causes unexpected 412s
+ { "if-range", NULL },
{ NULL, NULL }
};
@@ -804,6 +805,12 @@
}
}
+ // We don't support ranges and validation headers.
+ if (range_found && num_validation_headers) {
+ LOG(WARNING) << "Byte ranges AND validation headers found.";
+ effective_load_flags_ |= LOAD_DISABLE_CACHE;
+ }
+
if (range_found && !(effective_load_flags_ & LOAD_DISABLE_CACHE)) {
partial_.reset(new PartialData);
if (partial_->Init(request_->extra_headers, new_extra_headers)) {
@@ -814,6 +821,7 @@
custom_request_->extra_headers = new_extra_headers;
} else {
// The range is invalid or we cannot handle it properly.
+ LOG(WARNING) << "Invalid byte range found.";
effective_load_flags_ |= LOAD_DISABLE_CACHE;
partial_.reset(NULL);
}
« no previous file with comments | « no previous file | net/http/http_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698