fix(bikegear): pass proxy test when product listing is readable
This commit is contained in:
parent
91356cd6ac
commit
d4b12fdd69
@ -109,7 +109,7 @@ async function main() {
|
|||||||
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 hasChallengeTitle = /just a moment|attention required|access denied/i.test(title);
|
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 hasChallengeMarkup = /cf-error|cf-browser-verification/i.test(html);
|
||||||
const hasCloudflare = hasChallengeTitle || hasChallengeMarkup;
|
const hasCloudflare = hasChallengeTitle || hasChallengeMarkup;
|
||||||
|
|
||||||
console.log(`[BIKEGEAR-PROXY-TEST] status=${status}`);
|
console.log(`[BIKEGEAR-PROXY-TEST] status=${status}`);
|
||||||
@ -117,7 +117,7 @@ async function main() {
|
|||||||
console.log(`[BIKEGEAR-PROXY-TEST] productLinks=${productLinks}`);
|
console.log(`[BIKEGEAR-PROXY-TEST] productLinks=${productLinks}`);
|
||||||
console.log(`[BIKEGEAR-PROXY-TEST] cloudflarePage=${hasCloudflare}`);
|
console.log(`[BIKEGEAR-PROXY-TEST] cloudflarePage=${hasCloudflare}`);
|
||||||
|
|
||||||
if (status === 200 && productLinks > 0 && !hasCloudflare) {
|
if (status === 200 && productLinks > 0 && !hasChallengeTitle) {
|
||||||
console.log("[BIKEGEAR-PROXY-TEST] PASS browser can read BikeGear listing through this proxy.");
|
console.log("[BIKEGEAR-PROXY-TEST] PASS browser can read BikeGear listing through this proxy.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user