From 9711ad49552cc00b56268e814f779955ba754e75 Mon Sep 17 00:00:00 2001 From: Loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com> Date: Fri, 20 Dec 2024 22:10:48 +0800 Subject: [PATCH] Fix: use default IP files on format maxmindGeoLite2CountryCSV --- plugin/maxmind/country_csv_in.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugin/maxmind/country_csv_in.go b/plugin/maxmind/country_csv_in.go index cf721999..7b747b38 100644 --- a/plugin/maxmind/country_csv_in.go +++ b/plugin/maxmind/country_csv_in.go @@ -51,11 +51,10 @@ func newGeoLite2CountryCSV(action lib.Action, data json.RawMessage) (lib.InputCo tmp.CountryCodeFile = defaultCCFile } - if tmp.IPv4File == "" { + // When both of IP files are not specified, + // it means user wants to use the default ones + if tmp.IPv4File == "" && tmp.IPv6File == "" { tmp.IPv4File = defaultIPv4File - } - - if tmp.IPv6File == "" { tmp.IPv6File = defaultIPv6File }