lib/fullcontact/connection.rb in fullcontact-0.11.0 vs lib/fullcontact/connection.rb in fullcontact-0.12.0
- old
+ new
@@ -1,8 +1,9 @@
require 'faraday_middleware'
require 'faraday/request/gateway'
require 'faraday/response/fullcontact_errors'
+require 'faraday/response/add_headers'
require 'faraday/response/rubyize'
require 'faraday_middleware/response/mashify'
module FullContact
@@ -20,9 +21,10 @@
Faraday.new(options) do |builder|
builder.use Faraday::Request::UrlEncoded
builder.use Faraday::Request::Gateway, gateway if gateway
builder.use FaradayMiddleware::Mashify unless raw
+ builder.use Faraday::Response::AddHeaders if FullContact.include_headers_in_response
builder.use Faraday::Response::Rubyize unless raw or FullContact.skip_rubyize
unless raw
case format.to_s.downcase
when 'json'
builder.use Faraday::Response::ParseJson