From 7754b46dc4932a6e019b173713bfa5c80ad18f32 Mon Sep 17 00:00:00 2001 From: H1JK Date: Fri, 8 Mar 2024 22:45:10 +0800 Subject: [PATCH] fix: MaxMind MMDB code character case --- component/mmdb/reader.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/component/mmdb/reader.go b/component/mmdb/reader.go index 6247cd8a8..787bdfe8f 100644 --- a/component/mmdb/reader.go +++ b/component/mmdb/reader.go @@ -3,6 +3,7 @@ package mmdb import ( "fmt" "net" + "strings" "github.com/oschwald/maxminddb-golang" ) @@ -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