X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/a570f59187efa0a298d31bae2b224de9762bb42f..3666b674330ec8d14a224932a191d6121c5974e2:/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