diff options
| author | Loyalsoldier <[email protected]> | 2024-12-20 19:28:09 +0800 |
|---|---|---|
| committer | Loyalsoldier <[email protected]> | 2024-12-20 19:28:09 +0800 |
| commit | 724fbfc985340ee7839506d7f0b9c56ce4e140f6 (patch) | |
| tree | dfb1cadae63b1f1a8118e12acb35887b905f9863 /plugin | |
| parent | 9a1e35abb0926b94b0237d2d2041f48a6bdc1086 (diff) | |
Fix: use default IP files on format maxmindGeoLite2ASNCSV & maxmindGeoLite2CountryCSV202501300017202501230017202501160017202501090018202501020017
Diffstat (limited to 'plugin')
| -rw-r--r-- | plugin/maxmind/maxmind_asn_csv_in.go | 7 | ||||
| -rw-r--r-- | plugin/maxmind/maxmind_country_csv_in.go | 7 |
2 files changed, 6 insertions, 8 deletions
diff --git a/plugin/maxmind/maxmind_asn_csv_in.go b/plugin/maxmind/maxmind_asn_csv_in.go index a0882683..39d1e76a 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 ca58964d..366220ab 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 } |
