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

Unified Diff: content/browser/cache_storage/cache_storage_cache.cc

Issue 2204683002: Cache API should not match() HEAD requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unit tests Created 4 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 | content/browser/cache_storage/cache_storage_cache_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/cache_storage/cache_storage_cache.cc
diff --git a/content/browser/cache_storage/cache_storage_cache.cc b/content/browser/cache_storage/cache_storage_cache.cc
index 6dc652e7d3d00d2807912fb8ed3ab82d673e9854..25ebb8ff65806acc6d83e8818e983c36ae59c06d 100644
--- a/content/browser/cache_storage/cache_storage_cache.cc
+++ b/content/browser/cache_storage/cache_storage_cache.cc
@@ -692,6 +692,13 @@ void CacheStorageCache::MatchImpl(
return;
}
+ if (request->method == "HEAD") {
+ callback.Run(CACHE_STORAGE_ERROR_NOT_FOUND,
+ std::unique_ptr<ServiceWorkerResponse>(),
+ std::unique_ptr<storage::BlobDataHandle>());
+ return;
+ }
+
std::unique_ptr<disk_cache::Entry*> scoped_entry_ptr(
new disk_cache::Entry*());
disk_cache::Entry** entry_ptr = scoped_entry_ptr.get();
@@ -790,6 +797,12 @@ void CacheStorageCache::MatchAllImpl(
return;
}
+ if (request && request->method == "HEAD") {
jkarlin 2016/08/04 14:50:40 The updated spec reads that if it's a HEAD and opt
jkarlin 2016/08/04 14:52:18 This should really be a check to make sure that it
jsbell 2016/08/04 23:49:17 Done and done.
+ callback.Run(CACHE_STORAGE_OK, base::WrapUnique(new Responses),
+ base::WrapUnique(new BlobDataHandles));
+ return;
+ }
+
QueryCache(std::move(request), options,
base::Bind(&CacheStorageCache::MatchAllDidQueryCache,
weak_ptr_factory_.GetWeakPtr(), callback));
« no previous file with comments | « no previous file | content/browser/cache_storage/cache_storage_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698