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

fix(phisherman): fix api response handling issue when checking subdomains

This commit is contained in:
Dragory 2021-11-03 03:29:57 +02:00
parent 51ac585bea
commit e25f77d8a9

View file

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