diff --git a/api/dnssec.js b/api/dnssec.js index 6ef983b..0664799 100644 --- a/api/dnssec.js +++ b/api/dnssec.js @@ -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; }; diff --git a/api/hsts.js b/api/hsts.js index 63c6f07..a0c307b 100644 --- a/api/hsts.js +++ b/api/hsts.js @@ -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(); }); diff --git a/api/rank.js b/api/rank.js index b5d45d5..b44c874 100644 --- a/api/rank.js +++ b/api/rank.js @@ -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`, diff --git a/api/shodan.js b/api/shodan.js index 0615681..51a2eea 100644 --- a/api/shodan.js +++ b/api/shodan.js @@ -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'); diff --git a/api/tls-labs.js b/api/tls-labs.js index 09ad72d..19bd983 100644 --- a/api/tls-labs.js +++ b/api/tls-labs.js @@ -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;