Skip to content

Commit 5c448ba

Browse files
committed
case-sensitivity mismatch in geoipchecker.go
1. GeoIPCheckerFor stored country codes as-is (e.g., "CZ") 2. Check lowercased the lookup result before comparing (strings.ToLower(ipInfo.GetCountryCode())) So "CZ" in config never matched "cz" from the gRPC response.
1 parent 982394c commit 5c448ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/thoth/geoipchecker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func (c *Client) GeoIPCheckerFor(countries []string) checker.Impl {
1818
var sb strings.Builder
1919
fmt.Fprintln(&sb, "GeoIPChecker")
2020
for _, cc := range countries {
21-
countryMap[cc] = struct{}{}
21+
countryMap[strings.ToLower(cc)] = struct{}{}
2222
fmt.Fprintln(&sb, cc)
2323
}
2424

0 commit comments

Comments
 (0)