fix: MaxMind MMDB code character case

This commit is contained in:
H1JK 2024-03-08 22:45:10 +08:00 committed by wwqgtxx
parent 90d0ef033b
commit 7754b46dc4

View File

@ -3,6 +3,7 @@ package mmdb
import ( import (
"fmt" "fmt"
"net" "net"
"strings"
"github.com/oschwald/maxminddb-golang" "github.com/oschwald/maxminddb-golang"
) )
@ -26,7 +27,7 @@ func (r Reader) LookupCode(ipAddress net.IP) []string {
if country.Country.IsoCode == "" { if country.Country.IsoCode == "" {
return []string{} return []string{}
} }
return []string{country.Country.IsoCode} return []string{strings.ToLower(country.Country.IsoCode)}
case typeSing: case typeSing:
var code string var code string