X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/438496c6575ad037a2ec6ef0af3a112f80d446bc..64b3e289ac14533c6fb2b1223b6417ad0446878c:/lib/osm.rb?ds=sidebyside 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