1

I am using intl-tel-input on a production environment. The default requests for the intl-tel-input ipinfo.io are in HTTPS. This does not happen in my development environment as requests are in HTTP.

Is there any way to override this so that I can use HTTP in production?

My code is:

var load_intlTelInput = function(){
    $("#my_phone_number").intlTelInput({
        defaultCountry: "auto"
    });
};

PS: There are no intl-tel-input or ipinfo tags.

steel
  • 11,883
  • 7
  • 72
  • 109
atw
  • 5,428
  • 10
  • 39
  • 63

2 Answers2

2

Looking at the intl-tel-input code at https://github.com/Bluefieldscom/intl-tel-input/blob/42b64c002da735e8c0a90f012083d0d5c67df4c4/examples/js/defaultCountryIp.js the request is always made as a HTTP call, and not a HTTPS call.

If your question is how do you make the call via HTTPS you'll need to modify that code to request https://ipinfo.io instead, or you could change it to call //ipinfo.io (no http or https) so that it'll match the protocol of the page it's on (either http or https).

Note that using http://ipinfo.io via HTTPS is limited to paid subscribers, so you'll also need to signup for an access token at https://ipinfo.io/pricing and then add your token to the requests.

Ben Dowling
  • 17,187
  • 8
  • 87
  • 103
0

The version of intl-tel-input did not allow for enough customisation in terms of specifying a request and in produciton mode it always defaulted to HTTPS. As we were using ipinfo with a free account. We were in turn blocked form making requests.

I simply updated to the latest version of the software(this is not spam) and specified a custom request. More information can be found on the issues page for intl-tel-input here.

atw
  • 5,428
  • 10
  • 39
  • 63