From 7146f8c01dedfbdfa67e2711789a771c49935534 Mon Sep 17 00:00:00 2001 From: Bapu Sethi Date: Tue, 2 Jun 2026 10:27:11 +1000 Subject: [PATCH 1/3] fix exception of unsupported media from FullContact --- lib/fc_enrich/http_client.rb | 4 +++- spec/fc_enrich/http_client_spec.rb | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/fc_enrich/http_client.rb b/lib/fc_enrich/http_client.rb index 2975426..ccbc353 100644 --- a/lib/fc_enrich/http_client.rb +++ b/lib/fc_enrich/http_client.rb @@ -6,7 +6,9 @@ class HttpClient def post(path, payload_hash) response = RestClient.post("https://api.fullcontact.com#{path}", MultiJson.encode(payload_hash), - authorization: "Bearer #{FcEnrich.api_key}") + authorization: "Bearer #{FcEnrich.api_key}", + content_type: :json, + accept: :json) MultiJson.decode(response.body) rescue RestClient::NotFound, RestClient::UnprocessableEntity, RestClient::Gone nil diff --git a/spec/fc_enrich/http_client_spec.rb b/spec/fc_enrich/http_client_spec.rb index 49a8def..e9a0dcf 100644 --- a/spec/fc_enrich/http_client_spec.rb +++ b/spec/fc_enrich/http_client_spec.rb @@ -8,7 +8,8 @@ module FcEnrich stub_request(:post, "https://api.fullcontact.com/v3/person.enrich") .with( body: "{\"my_data\":\"true\"}", - headers: { 'Authorization' => 'Bearer TEST!' } + headers: { 'Authorization' => 'Bearer TEST!', 'Accept' => 'application/json', + 'Content-Type' => 'application/json' } ) .to_return(status: 200, body: { "return" => "result" }.to_json) From f637c7fd5a8f8c836b55aa2f16c196a66584a083 Mon Sep 17 00:00:00 2001 From: Bapu Sethi Date: Tue, 2 Jun 2026 10:33:00 +1000 Subject: [PATCH 2/3] version fix --- lib/fc_enrich/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fc_enrich/version.rb b/lib/fc_enrich/version.rb index 0a1356b..4db6f74 100644 --- a/lib/fc_enrich/version.rb +++ b/lib/fc_enrich/version.rb @@ -1,3 +1,3 @@ module FcEnrich - VERSION = "0.4.0" + VERSION = "0.4.1" end From 65dbefa70f88f9a2c246a6e22f6a0774df1ff30a Mon Sep 17 00:00:00 2001 From: Bapu Sethi Date: Tue, 2 Jun 2026 12:13:02 +1000 Subject: [PATCH 3/3] review fixes --- CHANGELOG.md | 3 +++ spec/fc_enrich/http_client_spec.rb | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8e5c2f..5aceee4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## [0.4.1] +* Add explict accept type for RestClient while requesting progile from FullContact + ## [0.4.0] * Add RestClient::Gone exception handling to return nil for HTTP 410 responses * Add test coverage for RestClient::Gone exception handling diff --git a/spec/fc_enrich/http_client_spec.rb b/spec/fc_enrich/http_client_spec.rb index e9a0dcf..c3bd41a 100644 --- a/spec/fc_enrich/http_client_spec.rb +++ b/spec/fc_enrich/http_client_spec.rb @@ -8,8 +8,9 @@ module FcEnrich stub_request(:post, "https://api.fullcontact.com/v3/person.enrich") .with( body: "{\"my_data\":\"true\"}", - headers: { 'Authorization' => 'Bearer TEST!', 'Accept' => 'application/json', - 'Content-Type' => 'application/json' } + headers: { 'Authorization' => 'Bearer TEST!', + 'Accept' => %r{\Aapplication/json\b}, + 'Content-Type' => %r{\Aapplication/json\b} } ) .to_return(status: 200, body: { "return" => "result" }.to_json)