mirror of https://github.com/gorhill/uBlock.git
Support disabling advanced setting `cacheControlForFirefox1376932`
Related feedback: - https://github.com/uBlockOrigin/uBlock-issues/issues/229#issuecomment-520810161 Setting `cacheControlForFirefox1376932` to `unset` will prevent modification of the `Cache-Control` header.
This commit is contained in:
parent
970164e78d
commit
52925ba2f9
|
@ -483,14 +483,16 @@ const onHeadersReceived = function(details) {
|
||||||
// Use `no-cache` instead of `no-cache, no-store, must-revalidate`, this
|
// Use `no-cache` instead of `no-cache, no-store, must-revalidate`, this
|
||||||
// allows Firefox's offline mode to work as expected.
|
// allows Firefox's offline mode to work as expected.
|
||||||
if ( (filteredHTML || modifiedHeaders) && dontCacheResponseHeaders ) {
|
if ( (filteredHTML || modifiedHeaders) && dontCacheResponseHeaders ) {
|
||||||
let i = headerIndexFromName('cache-control', responseHeaders);
|
|
||||||
let cacheControl = µb.hiddenSettings.cacheControlForFirefox1376932;
|
let cacheControl = µb.hiddenSettings.cacheControlForFirefox1376932;
|
||||||
if ( i !== -1 ) {
|
if ( cacheControl !== 'unset' ) {
|
||||||
responseHeaders[i].value = cacheControl;
|
let i = headerIndexFromName('cache-control', responseHeaders);
|
||||||
} else {
|
if ( i !== -1 ) {
|
||||||
responseHeaders.push({ name: 'Cache-Control', value: cacheControl });
|
responseHeaders[i].value = cacheControl;
|
||||||
|
} else {
|
||||||
|
responseHeaders.push({ name: 'Cache-Control', value: cacheControl });
|
||||||
|
}
|
||||||
|
modifiedHeaders = true;
|
||||||
}
|
}
|
||||||
modifiedHeaders = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( modifiedHeaders ) {
|
if ( modifiedHeaders ) {
|
||||||
|
|
Loading…
Reference in New Issue