fix(phisherman): fix api response handling issue when checking subdomains
This commit is contained in:
parent
4bdce129b3
commit
fb44a6558f
1 changed files with 3 additions and 2 deletions
|
@ -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") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue