Bug 1440565 P1 Make sure to clear any existing cache related load flags when setting the default fetch() RequestCache value. r=asuth

This commit is contained in:
Ben Kelly 2018-02-28 10:34:13 -08:00
parent 8c55bc6898
commit 251a6dfaf4

View File

@ -2893,6 +2893,12 @@ HttpBaseChannel::SetFetchCacheMode(uint32_t aFetchCacheMode)
// Now, set the load flags that implement each cache mode. // Now, set the load flags that implement each cache mode.
switch (aFetchCacheMode) { 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: case nsIHttpChannelInternal::FETCH_CACHE_MODE_NO_STORE:
// no-store means don't consult the cache on the way to the network, and // 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. // don't store the response in the cache even if it's cacheable.