better empty threatthypes handling

This commit is contained in:
Ethan Knowlton 2023-10-05 12:20:30 -04:00
parent 35187e67e5
commit 9217488362
2 changed files with 8 additions and 8 deletions

View File

@ -62,7 +62,7 @@ func (ips *IPStack) ParseSecurityResponse(parserResponse *parser.Response) {
CrawlerName: ips.response.Security.CrawlerName,
CrawlerType: ips.response.Security.CrawlerType,
ThreatLevel: ips.response.Security.ThreatLevel,
ThreatTypes: ips.response.Security.ThreatTypes,
ThreatTypes: ips.response.Security.ThreatTypes.([]string),
}
}
}

View File

@ -21,13 +21,13 @@ type Currency struct {
}
type Security struct {
IsProxy bool `json:"is_proxy"`
IsCrawler bool `json:"is_crawler"`
CrawlerName string `json:"crawler_name,omitempty"`
CrawlerType string `json:"crawler_type,omitempty"`
IsTor bool `json:"is_tor"`
ThreatLevel string `json:"threat_level,omitempty"`
ThreatTypes interface{} `json:"threat_types,omitempty"`
IsProxy bool `json:"is_proxy"`
IsCrawler bool `json:"is_crawler"`
CrawlerName string `json:"crawler_name,omitempty"`
CrawlerType string `json:"crawler_type,omitempty"`
IsTor bool `json:"is_tor"`
ThreatLevel string `json:"threat_level,omitempty"`
ThreatTypes []string `json:"threat_types,omitempty"`
}
type Timezone struct {