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

Unified Diff: third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp

Issue 2204683002: Cache API should not match() HEAD requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add keys()/delete() tests, fix found issues 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
Index: third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp
diff --git a/third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp b/third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp
index ec8460cdf35ef6adfb7aca6dfbaa9593b0e5cf41..526ed8a7e71513fdcc5e23341a8984e03becb0f6 100644
--- a/third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp
+++ b/third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp
@@ -320,6 +320,11 @@ ScriptPromise CacheStorage::matchImpl(ScriptState* scriptState, const Request* r
ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
const ScriptPromise promise = resolver->promise();
+ if (request->method() != HTTPNames::GET && !options.ignoreMethod()) {
+ resolver->resolve();
+ return promise;
+ }
+
if (m_webCacheStorage)
m_webCacheStorage->dispatchMatch(new MatchCallbacks(resolver), webRequest, Cache::toWebQueryParams(options));
else

Powered by Google App Engine
This is Rietveld 408576698