diff --git a/README.md b/README.md index 44ebdd014217f9983c0cbb9bc5a2d4ff60adc5b1..d8545990ee2caca05b2e9bb78e35b9748f67b9b9 100644 --- a/README.md +++ b/README.md @@ -580,7 +580,7 @@ Data Science Toolkit provides an API whose reponse format is like Google's but w * **API key**: requires auth_id and auth_token (set `Geocoder.configure(:api_key => [id, token])`) * **Quota**: 10,000 free, 250/month then purchase at sliding scale. * **Region**: US -* **SSL support**: yes +* **SSL support**: yes (required) * **Languages**: en * **Documentation**: http://smartystreets.com/kb/liveaddress-api/rest-endpoint * **Terms of Service**: http://smartystreets.com/legal/terms-of-service diff --git a/lib/geocoder/lookups/smarty_streets.rb b/lib/geocoder/lookups/smarty_streets.rb index db48738fd94d1efcbdee44e9c6a6342f085b0c55..2aebf07a1c71b6260af98846a39c24604883f783 100644 --- a/lib/geocoder/lookups/smarty_streets.rb +++ b/lib/geocoder/lookups/smarty_streets.rb @@ -18,6 +18,10 @@ module Geocoder::Lookup private # --------------------------------------------------------------- + def protocol + "https" # required by API as of 26 March 2015 + end + def zipcode_only?(query) !query.text.is_a?(Array) and query.to_s.strip =~ /\A\d{5}(-\d{4})?\Z/ end diff --git a/test/unit/lookups/smarty_streets_test.rb b/test/unit/lookups/smarty_streets_test.rb index b9c7f0c7d90de197cbd8ae9682eeb313909d4fd2..7befd0446b58d2dad04ff01ec0002308ad29adb9 100644 --- a/test/unit/lookups/smarty_streets_test.rb +++ b/test/unit/lookups/smarty_streets_test.rb @@ -11,7 +11,7 @@ class SmartyStreetsTest < GeocoderTestCase def test_url_contains_api_key Geocoder.configure(:smarty_streets => {:api_key => 'blah'}) query = Geocoder::Query.new("Bluffton, SC") - assert_equal "http://api.smartystreets.com/street-address?auth-token=blah&street=Bluffton%2C+SC", query.url + assert_equal "https://api.smartystreets.com/street-address?auth-token=blah&street=Bluffton%2C+SC", query.url end def test_query_for_address_geocode