From 1c3abb2ec3ad72495d61763cbcad87fa6c99e1d7 Mon Sep 17 00:00:00 2001 From: JimhHan <50871214+JimhHan@users.noreply.github.com> Date: Thu, 8 Apr 2021 19:18:23 +0800 Subject: [PATCH] Fix: config loader --- common/matcher/geoip/conf.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/matcher/geoip/conf.go b/common/matcher/geoip/conf.go index e1595340..5760409a 100644 --- a/common/matcher/geoip/conf.go +++ b/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)