3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

debug(phisherman): gracefully handle and log unexpected API responses

This commit is contained in:
Dragory 2021-11-02 22:48:54 +02:00
parent c5b2812452
commit ecd9a5863c
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -130,6 +130,11 @@ async function fetchDomainInfo(domain: string): Promise<PhishermanDomainInfo | n
console.log(`[PHISHERMAN] Requesting domain information: ${domain}`);
const result = await apiCall<Record<string, DomainInfoApiCallResult>>("GET", `/v2/domains/info/${domain}`);
const domainInfo = result[domain];
if (!domainInfo) {
// tslint:disable-next-line:no-console
console.warn("Unexpected Phisherman API response:", result);
return null;
}
if (domainInfo.classification === "unknown") {
return null;
}