Bug 1436134 - disable rcwn for non-safe http methods r=valentin
authorPatrick McManus <mcmanus@ducksong.com>
Tue, 06 Feb 2018 14:16:03 -0500
changeset 402634 ddb0033c54cb2175ffa1b58d0a3554808895c54f
parent 402633 8e6d2f2f7f30c9a6ad78cb33544f855c9dad6b18
child 402635 80fd16267d7f2da670f6e21253a99aaa096a0f84
push id33394
push userrgurzau@mozilla.com
push dateWed, 07 Feb 2018 00:14:43 +0000
treeherdermozilla-central@f033d62a90ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin
bugs1436134
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1436134 - disable rcwn for non-safe http methods r=valentin MozReview-Commit-ID: 3Ip1M7L3gUl
netwerk/protocol/http/nsHttpChannel.cpp
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -3733,17 +3733,17 @@ nsHttpChannel::OpenCacheEntryInternal(bo
             getter_AddRefs(cacheStorage));
     }
     else {
         bool lookupAppCache = (mChooseApplicationCache || (mLoadFlags & LOAD_CHECK_OFFLINE_CACHE)) &&
                               !mPostID &&
                               MOZ_LIKELY(allowApplicationCache);
         // Try to race only if we use disk cache storage and we don't lookup
         // app cache first
-        maybeRCWN = !lookupAppCache;
+        maybeRCWN = (!lookupAppCache) && mRequestHead.IsSafeMethod();
         rv = cacheStorageService->DiskCacheStorage(
             info, lookupAppCache, getter_AddRefs(cacheStorage));
     }
     NS_ENSURE_SUCCESS(rv, rv);
 
     if ((mClassOfService & nsIClassOfService::Leader) ||
         (mLoadFlags & LOAD_INITIAL_DOCUMENT_URI))
         cacheEntryOpenFlags |= nsICacheStorage::OPEN_PRIORITY;