revert: Revert "fix: remove turnstyle detection to check if it causes false-positives"
This reverts commit c10ca29fda.
This commit is contained in:
parent
1433d032f3
commit
60f44c9603
1 changed files with 4 additions and 2 deletions
|
|
@ -118,7 +118,9 @@ export class Fetcher {
|
|||
};
|
||||
|
||||
private async handleHttpCacheItem(ctx: Context, httpCacheItem: HttpCacheItem, url: URL, init?: CustomRequestInit): Promise<HttpCacheItem> {
|
||||
if (httpCacheItem.status && httpCacheItem.status >= 200 && httpCacheItem.status <= 399) {
|
||||
const triggeredCloudflareTurnstile = httpCacheItem.body.includes('cf-turnstile');
|
||||
|
||||
if (httpCacheItem.status && httpCacheItem.status >= 200 && httpCacheItem.status <= 399 && !triggeredCloudflareTurnstile) {
|
||||
return httpCacheItem;
|
||||
}
|
||||
|
||||
|
|
@ -126,7 +128,7 @@ export class Fetcher {
|
|||
throw new NotFoundError();
|
||||
}
|
||||
|
||||
if (httpCacheItem.headers['cf-mitigated'] === 'challenge') {
|
||||
if (httpCacheItem.headers['cf-mitigated'] === 'challenge' || triggeredCloudflareTurnstile) {
|
||||
const noFlareSolverr = init?.noFlareSolverr ?? false;
|
||||
const flareSolverrEndpoint = envGet('FLARESOLVERR_ENDPOINT');
|
||||
if (noFlareSolverr || !flareSolverrEndpoint) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue