MCPcopy
hub / github.com/lissy93/web-check / threatsHandler

Function threatsHandler

api/threats.js:81–93  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

79
80// Aggregate four threat-feed lookups; skip the card if every source failed
81const threatsHandler = async (url) => {
82 const sources = await Promise.all([
83 safeBrowsing(url),
84 urlHaus(url),
85 phishTank(url),
86 cloudmersive(url),
87 ]);
88 const [safe, haus, phish, cloud] = sources;
89 if (sources.every((s) => s?.error || s?.skipped)) {
90 return { skipped: 'No threat sources returned data for this host' };
91 }
92 return { safeBrowsing: safe, urlHaus: haus, phishTank: phish, cloudmersive: cloud };
93};
94
95export const handler = middleware(threatsHandler);
96export default handler;

Callers

nothing calls this directly

Calls 4

safeBrowsingFunction · 0.85
urlHausFunction · 0.85
phishTankFunction · 0.85
cloudmersiveFunction · 0.85

Tested by

no test coverage detected