Skip to content

Commit

Permalink
ci: skip website check on cloudflare protected endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
aslafy-z authored Oct 16, 2023
1 parent 4615df8 commit 670d3b7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/functional/data.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
Expand Down

0 comments on commit 670d3b7

Please sign in to comment.