Fix: config loader

This commit is contained in:
JimhHan 2021-04-08 19:18:23 +08:00
parent 5d5beb2028
commit 1c3abb2ec3
No known key found for this signature in database
GPG Key ID: 48D5D7CF95157AC5

View File

@ -100,6 +100,11 @@ func ParaseIPList(ips []string) ([]*GeoIP, error) {
if strings.HasPrefix(ip, "geoip:") { if strings.HasPrefix(ip, "geoip:") {
country := ip[6:] country := ip[6:]
isReverseMatch := false isReverseMatch := false
if strings.HasPrefix(country, "!") {
country = country[1:]
isReverseMatch = true
}
geoipc, err := LoadGeoIP(strings.ToUpper(country)) geoipc, err := LoadGeoIP(strings.ToUpper(country))
if err != nil { if err != nil {
return nil, newError("failed to load GeoIP: ", country).Base(err) return nil, newError("failed to load GeoIP: ", country).Base(err)