merge upstream, improve geoip pkg

This commit is contained in:
uubulb committed 2024-10-31 03:34:25 +08:00
commit 6eb28d03b3
7 files changed
+31 -42

No files matched your search

+1 -2
View File
@@ -212,10 +212,9 @@ func (s *NezhaHandler) LookupGeoIP(c context.Context, r *pb.GeoIP) (*pb.GeoIP, e
}
// 根据内置数据库查询 IP 地理位置
record := &geoip.IPInfo{}
ip := r.GetIp()
netIP := net.ParseIP(ip)
location, err := geoip.Lookup(netIP, record)
location, err := geoip.Lookup(netIP)
if err != nil {
return nil, err
}