Skip to content

fix: Thoth geoip compare#1564

Open
lenny87 wants to merge 2 commits intoTecharoHQ:mainfrom
lenny87:thoth-geoip-compare-fix
Open

fix: Thoth geoip compare#1564
lenny87 wants to merge 2 commits intoTecharoHQ:mainfrom
lenny87:thoth-geoip-compare-fix

Conversation

@lenny87
Copy link
Copy Markdown

@lenny87 lenny87 commented Apr 15, 2026

There is 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", according to docs, in config never matched "cz" from the gRPC response.

Checklist:

  • Added a description of the changes to the [Unreleased] section of docs/docs/CHANGELOG.md
  • [N] Added test cases to the relevant parts of the codebase
  • Ran integration tests npm run test:integration (unsupported on Windows, please use WSL)
  • All of my commits have verified signatures

@lenny87 lenny87 changed the title Thoth geoip compare fix fix: Thoth geoip compare Apr 15, 2026
lenny87 added 2 commits April 15, 2026 21:03
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.

Signed-off-by: Jakub Lansky <jakub@lansky.biz>
Signed-off-by: Jakub Lansky <jakub@lansky.biz>
@lenny87 lenny87 force-pushed the thoth-geoip-compare-fix branch from 137b672 to d75bf80 Compare April 15, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant