Adds functionality for threats, malware, phishing, viruses

This commit is contained in:
Alicia Sykes
2023-08-19 22:00:15 +01:00
parent 83c8d311b3
commit 759bb603df
4 changed files with 23 additions and 6 deletions

View File

@@ -52,6 +52,9 @@ const handler = async (url) => {
const urlHaus = await getUrlHausResult(url);
const phishTank = await getPhishTankResult(url);
const cloudmersive = await getCloudmersiveResult(url);
if (urlHaus.error && phishTank.error && cloudmersive.error) {
throw new Error(`All requests failed - ${urlHaus.error} ${phishTank.error} ${cloudmersive.error}`);
}
return JSON.stringify({ urlHaus, phishTank, cloudmersive });
} catch (error) {
throw new Error(error.message);