X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/438496c6575ad037a2ec6ef0af3a112f80d446bc..979a474c682c894125e0fe9ddfc5bae566ad895c:/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