Skip to content

Commit

Permalink
Fix: use default IP files on format maxmindGeoLite2ASNCSV & maxmindGe…
Browse files Browse the repository at this point in the history
…oLite2CountryCSV
  • Loading branch information
Loyalsoldier committed Dec 20, 2024
1 parent 9a1e35a commit 724fbfc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions plugin/maxmind/maxmind_asn_csv_in.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
7 changes: 3 additions & 4 deletions plugin/maxmind/maxmind_country_csv_in.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 724fbfc

Please sign in to comment.