fix(bikegear): avoid false Cloudflare challenge in proxy test
This commit is contained in:
parent
78bc7c5140
commit
91356cd6ac
@ -108,7 +108,9 @@ async function main() {
|
||||
const title = await page.title().catch(() => "");
|
||||
const html = await page.content();
|
||||
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] title=${title || "-"}`);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user