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

Function cloudmersive

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

Source from the content-addressed store, hash-verified

58};
59
60const cloudmersive = async (url) => {
61 const auth = requireEnv('CLOUDMERSIVE_API_KEY', 'Cloudmersive');
62 if (auth.skipped) return auth;
63 try {
64 const res = await httpPost(
65 'https://api.cloudmersive.com/virus/scan/website',
66 `Url=${encodeURIComponent(url)}`,
67 {
68 headers: {
69 'Content-Type': 'application/x-www-form-urlencoded',
70 Apikey: auth.value,
71 },
72 },
73 );
74 return res.data;
75 } catch (error) {
76 return upstreamError(error, 'Cloudmersive');
77 }
78};
79
80// Aggregate four threat-feed lookups; skip the card if every source failed
81const threatsHandler = async (url) => {

Callers 1

threatsHandlerFunction · 0.85

Calls 3

requireEnvFunction · 0.90
httpPostFunction · 0.90
upstreamErrorFunction · 0.90

Tested by

no test coverage detected