X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/f5b00499c04cc13ce483ed9118a83bfa9ee4d246..473da378b74328b11ded63d5687167fe30d42ae0:/lib/osm.rb diff --git a/lib/osm.rb b/lib/osm.rb index 26ebca09f..3e4b5dcee 100644 --- a/lib/osm.rb +++ b/lib/osm.rb @@ -513,15 +513,8 @@ module OSM def self.ip_to_country(ip_address) ipinfo = maxmind_database.lookup(ip_address) if Settings.key?(:maxmind_database) - if ipinfo&.found? - country = ipinfo.country.iso_code - else - country = http_client.get("https://api.hostip.info/country.php?ip=#{ip_address}").body - country = "GB" if country == "UK" - end + return ipinfo.country.iso_code if ipinfo&.found? - country - rescue StandardError nil end