There was an error fetching the commit references. Please try again later.
Allow lookup service to fully opt-out of https
If you have an address geocoding service that you want to use HTTPS with and then attempt to use an ip_geocoder that does not support HTTPS (e.g. Telize) then the ip_geocoder lookups will fail because Geocoder::Lookups::Base#make_api_request turns on opts[:use_ssl] based on that single configuration value. Rather than allowing for per-provider HTTPS configuration I have just refactored Geocoder::Lookups::Base call a private `use_ssl?` method which can be overridden by individual lookup provider implementations. The default implementation of `use_ssl?` simply returns the value from the config thus preserving the existing behavior but this allows subclasses, like Telize, to override `use_ssl?` completely to return false and thus fully opt-out of HTTPS regardless of what the configuration was.
Showing
- lib/geocoder/lookups/base.rb 7 additions, 3 deletionslib/geocoder/lookups/base.rb
- lib/geocoder/lookups/telize.rb 4 additions, 0 deletionslib/geocoder/lookups/telize.rb
- test/integration/http_client_test.rb 6 additions, 0 deletionstest/integration/http_client_test.rb
- test/unit/lookups/telize_test.rb 6 additions, 0 deletionstest/unit/lookups/telize_test.rb
Loading
Please register or sign in to comment