From d6f3af5733de6806983fd5194521b498eeb6f692 Mon Sep 17 00:00:00 2001 From: pg9182 <96569817+pg9182@users.noreply.github.com> Date: Sun, 20 Nov 2022 04:42:06 -0500 Subject: pkg/regionmap: Add explicit mapping for Taiwan It isn't in the UN M.49 mapping. --- pkg/regionmap/region.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pkg/regionmap') diff --git a/pkg/regionmap/region.go b/pkg/regionmap/region.go index a72196d..de2e13f 100644 --- a/pkg/regionmap/region.go +++ b/pkg/regionmap/region.go @@ -102,6 +102,11 @@ func GetRegion(ip netip.Addr, r ip2location.Record) (string, error) { return "Antartica", nil } + // for Taiwan, use "Asia East" (it isn't in the UN M.49 mapping) + if r.CountryShort == "TW" { + return "Asia East", nil + } + // the rest are based on the M.49 mapping m49region, m49subRegion, _, ok := m49(r.CountryShort) if !ok { -- cgit v1.2.3