Unverified Commit 8c696d6c authored by Alexandre Dias's avatar Alexandre Dias
Browse files

Issue #3298992: geoplugin.net does not work on https

parent f22bc8d3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -14,13 +14,13 @@
          excludeCountries: exclude ? exclude.split("-") : [],
          onlyCountries: only ? only.split("-") : [],
          geoIpLookup: callback => {
            fetch(new Request("//www.geoplugin.net/json.gp"))
            fetch(new Request("//ipinfo.io/json"))
              .then(response => {
                if (response.status === 200) {
                  return response.json();
                }
              }).then(resp => {
                const countryCode = (resp && resp.geoplugin_countryCode) ? resp.geoplugin_countryCode : country;
                const countryCode = (resp && resp.country) ? resp.country : country;
                callback(countryCode);
              }).catch(error => {
                console.error(error);