chore(fetcher): use FlareSolverr also for other 403 Cloudflare responses

This commit is contained in:
WebStreamr 2025-06-04 15:16:56 +00:00
parent e6aa95f875
commit 7387aef764
No known key found for this signature in database

View file

@ -73,7 +73,10 @@ export class Fetcher {
const responseHeaders = httpCacheItem.policy.responseHeaders();
if (httpCacheItem.policy.responseHeaders()['cf-mitigated'] === 'challenge') {
if (
httpCacheItem.policy.responseHeaders()['cf-mitigated'] === 'challenge'
|| (httpCacheItem.status === 403 && httpCacheItem.policy.responseHeaders()['server'] === 'cloudflare')
) {
const flareSolverrEndpoint = envGet('FLARESOLVERR_ENDPOINT');
if (!flareSolverrEndpoint) {
throw new BlockedError('cloudflare_challenge', httpCacheItem.policy.responseHeaders());