From 251a6dfaf4d0a5faee0b58cdd2d94fc2fca2aa8a Mon Sep 17 00:00:00 2001 From: Ben Kelly Date: Wed, 28 Feb 2018 10:34:13 -0800 Subject: [PATCH] Bug 1440565 P1 Make sure to clear any existing cache related load flags when setting the default fetch() RequestCache value. r=asuth --- netwerk/protocol/http/HttpBaseChannel.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp index 61dc0881be47..3675394934ec 100644 --- a/netwerk/protocol/http/HttpBaseChannel.cpp +++ b/netwerk/protocol/http/HttpBaseChannel.cpp @@ -2893,6 +2893,12 @@ HttpBaseChannel::SetFetchCacheMode(uint32_t aFetchCacheMode) // Now, set the load flags that implement each cache mode. switch (aFetchCacheMode) { + case nsIHttpChannelInternal::FETCH_CACHE_MODE_DEFAULT: + // The "default" mode means to use the http cache normally and + // respect any http cache-control headers. We effectively want + // to clear our cache related load flags. + SetCacheFlags(mLoadFlags, 0); + break; case nsIHttpChannelInternal::FETCH_CACHE_MODE_NO_STORE: // no-store means don't consult the cache on the way to the network, and // don't store the response in the cache even if it's cacheable.