fix(bikegear): avoid false Cloudflare challenge in proxy test

This commit is contained in:
MOHAN 2026-08-01 18:39:24 +05:30
parent 78bc7c5140
commit 91356cd6ac

View File

@ -108,7 +108,9 @@ async function main() {
const title = await page.title().catch(() => ""); const title = await page.title().catch(() => "");
const html = await page.content(); const html = await page.content();
const productLinks = (html.match(/class="product-img/g) || []).length; const productLinks = (html.match(/class="product-img/g) || []).length;
const hasCloudflare = /cloudflare|cf-error|cf-browser-verification|Just a moment/i.test(html); const hasChallengeTitle = /just a moment|attention required|access denied/i.test(title);
const hasChallengeMarkup = /cf-error|cf-browser-verification|challenge-platform|cdn-cgi\/challenge-platform/i.test(html);
const hasCloudflare = hasChallengeTitle || hasChallengeMarkup;
console.log(`[BIKEGEAR-PROXY-TEST] status=${status}`); console.log(`[BIKEGEAR-PROXY-TEST] status=${status}`);
console.log(`[BIKEGEAR-PROXY-TEST] title=${title || "-"}`); console.log(`[BIKEGEAR-PROXY-TEST] title=${title || "-"}`);