Closed keroro520 closed 3 years ago
This is because hostname
isn't always available for some IPs:
$ curl http://ipinfo.io/8.8.8.8
{
"ip": "8.8.8.8",
"hostname": "dns.google",
"anycast": true,
"city": "Mountain View",
"region": "California",
"country": "US",
"loc": "37.4056,-122.0775",
"org": "AS15169 Google LLC",
"postal": "94043",
"timezone": "America/Los_Angeles",
"readme": "https://ipinfo.io/missingauth"
}
Will change it so hostname
is optional.
https://crates.io/crates/ipinfo/0.2.0 contains this update.
It seems that
hostname
is not included for the free accounts. Thelookup
function returns the below error which is caused by serde deserialization.I use
curl
to make a request and the response does not containhostname
either.