Revert "Reject downloaded lists which are deemed truncated"

This reverts commit de219dae26.
This commit is contained in:
Raymond Hill 2020-06-21 13:31:13 -04:00
parent 22864cc3a9
commit ec4de80345
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -771,22 +771,6 @@ const getRemote = async function(assetKey) {
? await api.fetchFilterList(contentURL) ? await api.fetchFilterList(contentURL)
: await api.fetchText(contentURL); : await api.fetchText(contentURL);
// https://www.reddit.com/r/uBlockOrigin/comments/hbpo86/
// Server sent a truncated list? If the new list is smaller than the
// currently cached one by more than 25%, assume a server error.
if (
stringIsNotEmpty(result.content) &&
typeof assetDetails.size === 'number' &&
assetDetails.size !== 0
) {
const loss = 1 - result.content.length / assetDetails.size;
if ( loss > 0.25 ) {
result.statusCode = 206;
result.statusText = 'Partial Content';
result.content = '';
}
}
// Failure // Failure
if ( stringIsNotEmpty(result.content) === false ) { if ( stringIsNotEmpty(result.content) === false ) {
let error = result.statusText; let error = result.statusText;
@ -804,10 +788,7 @@ const getRemote = async function(assetKey) {
content: result.content, content: result.content,
url: contentURL url: contentURL
}); });
registerAssetSource(assetKey, { registerAssetSource(assetKey, { error: undefined });
error: undefined,
size: result.content.length
});
return reportBack(result.content); return reportBack(result.content);
} }