Skip to content
Snippets Groups Projects
Unverified Commit 6435f4e6 authored by Alex Reisner's avatar Alex Reisner Committed by GitHub
Browse files

Merge pull request #1355 from rdlugosz/ipinfo_allows_https_for_all

Allow https for IPInfo.io queries without an API key
parents bb4af670 d1e03c81
No related branches found
No related tags found
No related merge requests found
......@@ -330,7 +330,7 @@ IP Address Lookups
* **API key**: optional - see http://ipinfo.io/pricing
* **Quota**: 1,000/day - more with api key
* **Region**: world
* **SSL support**: no (not without access key - see http://ipinfo.io/pricing)
* **SSL support**: yes
* **Languages**: English
* **Documentation**: http://ipinfo.io/developers
* **Terms of Service**: http://ipinfo.io/developers
......
......@@ -8,15 +8,6 @@ module Geocoder::Lookup
"Ipinfo.io"
end
# HTTPS available only for paid plans
def supported_protocols
if configuration.api_key
[:http, :https]
else
[:http]
end
end
private # ---------------------------------------------------------------
def base_query_url(query)
......
......@@ -2,19 +2,6 @@
require 'test_helper'
class IpinfoIoTest < GeocoderTestCase
def test_ipinfo_io_use_http_without_token
Geocoder.configure(:ip_lookup => :ipinfo_io, :use_https => true)
query = Geocoder::Query.new("8.8.8.8")
assert_match(/^http:/, query.url)
end
def test_ipinfo_io_uses_https_when_auth_token_set
Geocoder.configure(:ip_lookup => :ipinfo_io, :api_key => "FOO_BAR_TOKEN", :use_https => true)
query = Geocoder::Query.new("8.8.8.8")
assert_match(/^https:/, query.url)
end
def test_ipinfo_io_lookup_loopback_address
Geocoder.configure(:ip_lookup => :ipinfo_io)
result = Geocoder.search("127.0.0.1").first
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment