stadust / pointercrate

Rewrite of the https://pointercrate.com backend in Rust
MIT License
80 stars 52 forks source link

Cannot geolocate from certain regions #158

Open 1t1v opened 2 months ago

1t1v commented 2 months ago

Some regions have their own country codes despite not being independent, for example the country code RE is used for Réunion, which is a department of France, and does not use country code FR. When geolocating from one of these places, it looks like the website expects to recieve:

{
    "country_code": "FR", 
    "region_iso_code": "RE"
} 

from the abstractapi request, but instead it recieves:

{
    "country_code": "RE"
} 

which is not in the website's country database.

I can confirm that the geolocation feature does not work in Réunion as seen in this screeshot. geolocation fail

I can't know for sure if this is the case for every other region that fits this criteria, but here's a list of country codes I think might be affected by the bug:

AX, AS, AI, AQ, BM, BQ, BV, IO, KY, CX, CC, CK, CW, FK, FO, GF, PF, TF, GI, GL, GP, GU, HM, IM, JE, MO, MQ, YT, MS, NC, NU, NF, MP, PN, PR, RE, BL, SH, MF, PM, SX, GS, SJ, TK, TC, UM, VG, VI, WF, EH
stadust commented 2 months ago

Hey, thanks for the report. abstract returning the data the way it does is indeed unfortunate .-. I'll have to think about what to do here