Skip to content

Commit

Permalink
fix: MaxMind MMDB code character case
Browse files Browse the repository at this point in the history
  • Loading branch information
H1JK authored and wwqgtxx committed Mar 8, 2024
1 parent 90d0ef0 commit 7754b46
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion component/mmdb/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package mmdb
import (
"fmt"
"net"
"strings"

"github.com/oschwald/maxminddb-golang"
)
Expand All @@ -26,7 +27,7 @@ func (r Reader) LookupCode(ipAddress net.IP) []string {
if country.Country.IsoCode == "" {
return []string{}
}
return []string{country.Country.IsoCode}
return []string{strings.ToLower(country.Country.IsoCode)}

case typeSing:
var code string
Expand Down

0 comments on commit 7754b46

Please sign in to comment.