From 6fee44bd88bfe1e6fc14501ebf038f4f82bb1549 Mon Sep 17 00:00:00 2001 From: Evan Wechsler Date: Wed, 19 Aug 2020 14:11:02 -0400 Subject: [PATCH 1/2] Propagate api_key changes from upstream geocoder Ref: https://github.com/alexreisner/geocoder/commit/773ac0fb67ffc18172573e9c5b052126276e01c1 --- .../concerns/here_lookup_default_methods.rb | 27 +++++-------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/lib/geocoder/lookups/concerns/here_lookup_default_methods.rb b/lib/geocoder/lookups/concerns/here_lookup_default_methods.rb index 90b0387..b47ed55 100644 --- a/lib/geocoder/lookups/concerns/here_lookup_default_methods.rb +++ b/lib/geocoder/lookups/concerns/here_lookup_default_methods.rb @@ -7,37 +7,24 @@ def handle end def required_api_key_parts - ["app_id", "app_code"] + ["app_key"] + end + + def supported_protocols + [:https] end private def query_url_here_options(query) options = { - app_id: api_key, - app_code: api_code, + api_key: configuration.api_key, language: (query.language || configuration.language) } end - def api_key - if (a = configuration.api_key) - return a.first if a.is_a?(Array) - end - end - - def api_code - if (a = configuration.api_key) - return a.last if a.is_a?(Array) - end - end - def domain - if configuration.cit - 'cit.api.here.com' - else - 'api.here.com' - end + 'ls.hereapi.com' end end end From 8626033bd55938b1c27eccf217543099a13bc70b Mon Sep 17 00:00:00 2001 From: Evan Wechsler Date: Thu, 20 Aug 2020 10:30:29 -0400 Subject: [PATCH 2/2] Typo -> app_key to api_key --- lib/geocoder/lookups/concerns/here_lookup_default_methods.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/geocoder/lookups/concerns/here_lookup_default_methods.rb b/lib/geocoder/lookups/concerns/here_lookup_default_methods.rb index b47ed55..5d4f382 100644 --- a/lib/geocoder/lookups/concerns/here_lookup_default_methods.rb +++ b/lib/geocoder/lookups/concerns/here_lookup_default_methods.rb @@ -7,7 +7,7 @@ def handle end def required_api_key_parts - ["app_key"] + ["api_key"] end def supported_protocols @@ -18,7 +18,7 @@ def supported_protocols def query_url_here_options(query) options = { - api_key: configuration.api_key, + apikey: configuration.api_key, language: (query.language || configuration.language) } end