diff --git a/plugin/maxmind/maxmind_asn_csv_in.go b/plugin/maxmind/maxmind_asn_csv_in.go index a088268346e..39d1e76ae1c 100644 --- a/plugin/maxmind/maxmind_asn_csv_in.go +++ b/plugin/maxmind/maxmind_asn_csv_in.go @@ -45,11 +45,10 @@ func newGeoLite2ASNCSV(action lib.Action, data json.RawMessage) (lib.InputConver } } - 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 = defaultASNIPv4File - } - - if tmp.IPv6File == "" { tmp.IPv6File = defaultASNIPv6File } diff --git a/plugin/maxmind/maxmind_country_csv_in.go b/plugin/maxmind/maxmind_country_csv_in.go index ca58964d05b..366220abd79 100644 --- a/plugin/maxmind/maxmind_country_csv_in.go +++ b/plugin/maxmind/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 = defaultCountryIPv4File - } - - if tmp.IPv6File == "" { tmp.IPv6File = defaultCountryIPv6File }