lib/quick_travel/adapter.rb in quicktravel_client-4.4.0 vs lib/quick_travel/adapter.rb in quicktravel_client-4.5.0
- old
+ new
@@ -214,10 +214,11 @@
http_params[:query] ||= FilterQuery.new(query).call
http_params[:headers] ||= {}
http_params[:headers]['Content-length'] = '0' if http_params[:body].blank?
http_params[:headers]['x-api-key'] = QuickTravel.config.access_key
http_params[:headers]['user-agent'] = 'quicktravel_client/' + QuickTravel::VERSION;
+ http_params[:headers].merge!(extra_headers) if extra_headers
expect = http_params.delete(:expect)
# Use :body instead of :query for put/post.
#
@@ -250,9 +251,13 @@
end
validate!(response)
response
+ end
+
+ def self.extra_headers
+ QuickTravel.config.extra_headers
end
# Do standard validations on response
#
# Firstly, check if a valid HTTP code was returned