fix: abuse condition

This commit is contained in:
Yanlong Wang 2024-06-10 17:41:38 +08:00
parent 5789ae1407
commit 70d80bbcfe
No known key found for this signature in database
GPG Key ID: C0A623C0BADF9F37

View File

@ -572,7 +572,7 @@ ${suffixMixins.length ? `\n${suffixMixins.join('\n\n')}\n` : ''}`;
throw new SecurityCompromiseError(`Domain ${urlToCrawl.hostname} blocked until ${blockade.expireAt || 'Eternally'} due to previous abuse found on ${blockade.triggerUrl || 'site'}: ${blockade.triggerReason}`);
}
if (urlToCrawl.protocol === 'http:' && (!urlToCrawl.pathname || urlToCrawl.pathname === '/') &&
crawlerOptions.respondWith === 'html') {
crawlerOptions.respondWith !== 'default') {
throw new SecurityCompromiseError(`Your request is categorized as abuse. Please don't abuse our service. If you are sure you are not abusing, please authenticate yourself with an API key.`);
}