From 70d80bbcfec4fb92268b57d4a4c3034c9798071e Mon Sep 17 00:00:00 2001 From: Yanlong Wang Date: Mon, 10 Jun 2024 17:41:38 +0800 Subject: [PATCH] fix: abuse condition --- backend/functions/src/cloud-functions/crawler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/functions/src/cloud-functions/crawler.ts b/backend/functions/src/cloud-functions/crawler.ts index d7ae61e..813b426 100644 --- a/backend/functions/src/cloud-functions/crawler.ts +++ b/backend/functions/src/cloud-functions/crawler.ts @@ -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.`); }