From 670d3b7916b42b1b191a81cce04f0ccecfc02141 Mon Sep 17 00:00:00 2001 From: Zadkiel Aharonian Date: Mon, 16 Oct 2023 19:15:47 +0200 Subject: [PATCH] ci: skip website check on cloudflare protected endpoints --- test/functional/data.spec.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/functional/data.spec.js b/test/functional/data.spec.js index 3550985a6..94e4532c2 100644 --- a/test/functional/data.spec.js +++ b/test/functional/data.spec.js @@ -13,11 +13,14 @@ const requestOptions = { function checkURL(url, head = false) { const method = head ? 'head' : 'get'; - return got[method](url, requestOptions).then(({statusCode}) => { + return got[method](url, requestOptions).then(({statusCode, headers}) => { if (!head && statusCode === 403) { return checkURL(url, true); } - + // skip check for cloudflare protected websites + if (headers['cf-mitigated']) { + return; + } expect(statusCode).to.equal(200); }); }