ref: Remove per-job timeouts

This commit is contained in:
Alicia Sykes
2026-05-10 20:27:40 +01:00
parent cd112f88fe
commit c4f65e4b44
5 changed files with 2 additions and 15 deletions

View File

@@ -7,7 +7,6 @@ const queryDns = async (domain, type) => {
const res = await httpGet('https://dns.google/resolve', {
params: { name: domain, type },
headers: { Accept: 'application/dns-json' },
timeout: 5000,
});
return res.data;
};

View File

@@ -22,18 +22,12 @@ const evaluate = (header) => {
return verdict('Site is compatible with the HSTS preload list!', true, header);
};
const REQUEST_TIMEOUT = 5000;
const hstsHandler = async (url) =>
new Promise((resolve) => {
const req = https.request(url, (res) => {
resolve(evaluate(res.headers['strict-transport-security']));
res.resume();
});
req.setTimeout(REQUEST_TIMEOUT, () => {
req.destroy();
resolve({ error: 'HSTS check timed out' });
});
req.on('error', (e) => resolve({ error: `HSTS check failed: ${e.message}` }));
req.end();
});

View File

@@ -10,10 +10,7 @@ const rankHandler = async (url) => {
? { auth: { username: TRANCO_USERNAME, password: TRANCO_API_KEY } }
: {};
try {
const response = await httpGet(`https://tranco-list.eu/api/ranks/domain/${domain}`, {
timeout: 5000,
...auth,
});
const response = await httpGet(`https://tranco-list.eu/api/ranks/domain/${domain}`, auth);
if (!response.data?.ranks?.length) {
return {
skipped: `${domain} isn't ranked in the top 1 million sites yet`,

View File

@@ -9,9 +9,7 @@ const shodanHandler = async (url) => {
if (auth.skipped) return auth;
const { hostname } = parseTarget(url);
try {
const res = await httpGet(`https://api.shodan.io/shodan/host/${hostname}?key=${auth.value}`, {
timeout: 8000,
});
const res = await httpGet(`https://api.shodan.io/shodan/host/${hostname}?key=${auth.value}`);
return res.data;
} catch (error) {
return upstreamError(error, 'Shodan lookup');

View File

@@ -11,7 +11,6 @@ const tlsLabsHandler = async (url) => {
try {
const res = await httpGet(SSL_LABS, {
params: { host: hostname, fromCache: 'on', maxAge: 168, all: 'done' },
timeout: 8000,
headers: { 'User-Agent': 'web-check (https://web-check.xyz)' },
});
const data = res.data;