mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
Better processing of Expires
directive in filter list
In case of invalid `Expires` value -- i.e. `NaN` -- do not use `1` as default value, just let uBO pick the value according to the global default (which is `5` as of commit time).
This commit is contained in:
parent
dc64cfbd97
commit
18a5f41a04
@ -760,12 +760,15 @@ self.addEventListener('hiddenSettingsChanged', ( ) => {
|
|||||||
// Extract update frequency information
|
// Extract update frequency information
|
||||||
const matches = head.match(/(?:^|\n)(?:!|# )[\t ]*Expires[\t ]*:[\t ]*(\d+)[\t ]*(h)?/i);
|
const matches = head.match(/(?:^|\n)(?:!|# )[\t ]*Expires[\t ]*:[\t ]*(\d+)[\t ]*(h)?/i);
|
||||||
if ( matches !== null ) {
|
if ( matches !== null ) {
|
||||||
let v = Math.max(parseInt(matches[1], 10), 1);
|
let v = parseInt(matches[1], 10);
|
||||||
if ( matches[2] !== undefined ) {
|
if ( isNaN(v) === false ) {
|
||||||
v = Math.ceil(v / 24);
|
if ( matches[2] !== undefined ) {
|
||||||
}
|
v = Math.ceil(v / 24);
|
||||||
if ( v !== listEntry.updateAfter ) {
|
}
|
||||||
this.assets.registerAssetSource(assetKey, { updateAfter: v });
|
v = Math.max(v, 1);
|
||||||
|
if ( v !== listEntry.updateAfter ) {
|
||||||
|
this.assets.registerAssetSource(assetKey, { updateAfter: v });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user