From e755157553d5e294e0120b710e8482b977956c12 Mon Sep 17 00:00:00 2001 From: Adarsh N B Date: Wed, 30 Jan 2019 19:59:20 +0530 Subject: [PATCH 1/4] add api key in headers irrespective of auth type options; --- lib/fullcontact/request.rb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/fullcontact/request.rb b/lib/fullcontact/request.rb index 80123ad..9a623f9 100644 --- a/lib/fullcontact/request.rb +++ b/lib/fullcontact/request.rb @@ -10,16 +10,9 @@ def get(path, options={}, raw=false, faraday_options={}) # Perform an HTTP request def request(method, path, options, raw=false, faraday_options={}) - if FullContact.options[:auth_type] == :query - options[:apiKey] = FullContact.options[:api_key] - end - response = connection(raw, faraday_options).send(method) do |request| request.url(formatted_path(path), options) - - if FullContact.options[:auth_type] == :header - request.headers[FullContact::Configuration::AUTH_HEADER_NAME] = FullContact.options[:api_key] - end + request.headers[FullContact::Configuration::AUTH_HEADER_NAME] = FullContact.options[:api_key] end raw ? response : response.body From ae0b68b0be7eabbad57618ac3518ddfc1012e578 Mon Sep 17 00:00:00 2001 From: Adarsh N B Date: Wed, 30 Jan 2019 19:59:58 +0530 Subject: [PATCH 2/4] minor upgrade version --- lib/fullcontact/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fullcontact/version.rb b/lib/fullcontact/version.rb index 491d97f..364b8e8 100644 --- a/lib/fullcontact/version.rb +++ b/lib/fullcontact/version.rb @@ -1,3 +1,3 @@ module FullContact - VERSION = '0.18.0' + VERSION = '0.18.1' end From 03bd04049e4ecb7bc6138b9c6d4e69e2e0d70214 Mon Sep 17 00:00:00 2001 From: Adarsh N B Date: Sun, 24 Feb 2019 23:24:48 +0530 Subject: [PATCH 3/4] mock options of api_key for now --- lib/fullcontact/request.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/fullcontact/request.rb b/lib/fullcontact/request.rb index 9a623f9..a9dbe10 100644 --- a/lib/fullcontact/request.rb +++ b/lib/fullcontact/request.rb @@ -11,6 +11,9 @@ def get(path, options={}, raw=false, faraday_options={}) # Perform an HTTP request def request(method, path, options, raw=false, faraday_options={}) response = connection(raw, faraday_options).send(method) do |request| + if FullContact.options[:auth_type] == :query + options[:apiKey] = FullContact.options[:api_key] + end request.url(formatted_path(path), options) request.headers[FullContact::Configuration::AUTH_HEADER_NAME] = FullContact.options[:api_key] end From caf62280e567c127088c6a30c013b4e460f000eb Mon Sep 17 00:00:00 2001 From: Adarsh N B Date: Sun, 3 Mar 2019 14:07:33 +0530 Subject: [PATCH 4/4] added change log --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 7b76637..0db8492 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ A Ruby wrapper for the [FullContact API](http://www.fullcontact.com/) Changes ------- +- 0.18.1 + - Always use the token in header even when the option is given as query. - 0.18.0 - Add ability to query Company API by company name - Fix XML bug in Company API module