Fix evaluation of "Cache-Control: no-cache, no-store" header value (see issue #2283)
Choose the stricter "no-cache" behavior which implies the "no-store" behavior.
This commit is contained in:
parent
6011d45e38
commit
35295d2e27
|
@ -168,13 +168,16 @@ blink::mojom::FetchCacheMode GetFetchCacheMode(int ur_flags) {
|
||||||
const bool only_from_cache{ur_flags & UR_FLAG_ONLY_FROM_CACHE};
|
const bool only_from_cache{ur_flags & UR_FLAG_ONLY_FROM_CACHE};
|
||||||
const bool disable_cache{ur_flags & UR_FLAG_DISABLE_CACHE};
|
const bool disable_cache{ur_flags & UR_FLAG_DISABLE_CACHE};
|
||||||
if (only_from_cache && (skip_cache || disable_cache)) {
|
if (only_from_cache && (skip_cache || disable_cache)) {
|
||||||
|
// The request will always fail because only_from_cache and
|
||||||
|
// skip_cache/disable_cache are mutually exclusive.
|
||||||
return blink::mojom::FetchCacheMode::kUnspecifiedForceCacheMiss;
|
return blink::mojom::FetchCacheMode::kUnspecifiedForceCacheMiss;
|
||||||
|
} else if (disable_cache) {
|
||||||
|
// This additionally implies the skip_cache behavior.
|
||||||
|
return blink::mojom::FetchCacheMode::kNoStore;
|
||||||
} else if (skip_cache) {
|
} else if (skip_cache) {
|
||||||
return blink::mojom::FetchCacheMode::kBypassCache;
|
return blink::mojom::FetchCacheMode::kBypassCache;
|
||||||
} else if (only_from_cache) {
|
} else if (only_from_cache) {
|
||||||
return blink::mojom::FetchCacheMode::kOnlyIfCached;
|
return blink::mojom::FetchCacheMode::kOnlyIfCached;
|
||||||
} else if (disable_cache) {
|
|
||||||
return blink::mojom::FetchCacheMode::kNoStore;
|
|
||||||
}
|
}
|
||||||
return blink::mojom::FetchCacheMode::kDefault;
|
return blink::mojom::FetchCacheMode::kDefault;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue