mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-06 05:30:05 +00:00
fix: agent ipv6 info
This commit is contained in:
@@ -65,10 +65,11 @@ func GetHost() *model.Host {
|
|||||||
if err == nil {
|
if err == nil {
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
body, _ := ioutil.ReadAll(resp.Body)
|
body, _ := ioutil.ReadAll(resp.Body)
|
||||||
if ip.IP == "" {
|
json.Unmarshal(body, &ip)
|
||||||
cachedIP = string(body)
|
if cachedIP == "" {
|
||||||
|
cachedIP = ip.IP
|
||||||
} else {
|
} else {
|
||||||
cachedIP = fmt.Sprintf("ip(v4: %s, v6: %s)", ip.IP, body)
|
cachedIP = fmt.Sprintf("ip(v4: %s, v6: %s)", cachedIP, ip.IP)
|
||||||
}
|
}
|
||||||
country = ip.CountryCode
|
country = ip.CountryCode
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user