JimhHan 5 лет назад
Родитель
Сommit
1c3abb2ec3
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      common/matcher/geoip/conf.go

+ 5 - 0
common/matcher/geoip/conf.go

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