Skip to content

Commit

Permalink
put back nocache cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
kwypchlo committed Aug 10, 2022
1 parent fd34e59 commit 9ef3394
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/checks/critical.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,12 @@ async function genericAccessCheck(name, url) {
const data = { up: false, url };

try {
const response = await got(url, { headers: { "Skynet-Api-Key": process.env.ACCOUNTS_TEST_USER_API_KEY } });
const response = await got(url, {
headers: {
cookie: "nocache=true",
"Skynet-Api-Key": process.env.ACCOUNTS_TEST_USER_API_KEY,
},
});

data.statusCode = response.statusCode;
data.up = true;
Expand Down
10 changes: 8 additions & 2 deletions src/checks/extended.js
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,10 @@ async function skylinkVerification(done, expected, { followRedirect = true, meth
const query = `https://${process.env.PORTAL_DOMAIN}/${expected.skylink}`;
const response = await got[method](query, {
followRedirect,
headers: { "Skynet-Api-Key": process.env.ACCOUNTS_TEST_USER_API_KEY },
headers: {
cookie: "nocache=true",
"Skynet-Api-Key": process.env.ACCOUNTS_TEST_USER_API_KEY,
},
});
const entry = { ...details, up: true, statusCode: response.statusCode, time: calculateElapsedTime(time) };
const info = {};
Expand Down Expand Up @@ -1176,7 +1179,10 @@ async function skylinkVerification(done, expected, { followRedirect = true, meth
const url = `https://${process.env.PORTAL_DOMAIN}/skynet/metadata/${skylink}`;
try {
const metadata = await got(url, {
headers: { "Skynet-Api-Key": process.env.ACCOUNTS_TEST_USER_API_KEY },
headers: {
cookie: "nocache=true",
"Skynet-Api-Key": process.env.ACCOUNTS_TEST_USER_API_KEY,
},
}).json();
if (!isEqual(expected.metadata, metadata)) {
entry.up = false;
Expand Down

0 comments on commit 9ef3394

Please sign in to comment.