lib/github_api/connection.rb in github_api-0.3.3 vs lib/github_api/connection.rb in github_api-0.3.4
- old
+ new
@@ -10,10 +10,18 @@
require 'github_api/request/basic_auth'
module Github
module Connection
+ ALLOWED_OPTIONS = [
+ :headers,
+ :url,
+ :params,
+ :request,
+ :ssl
+ ].freeze
+
private
def header_options() # :nodoc:
{
:headers => {
@@ -40,16 +48,14 @@
# merged_options = if connection_options.empty?
# header_options.merge(options)
# else
# connection_options.merge(header_options)
# end
- merged_options = header_options.merge(options)
-
+ merged_options = _filter_params_keys(ALLOWED_OPTIONS, header_options.merge(options))
clear_cache unless options.empty?
@connection ||= begin
Faraday.new(merged_options) do |builder|
-
puts options.inspect
builder.use Faraday::Request::JSON
builder.use Faraday::Request::Multipart
builder.use Faraday::Request::UrlEncoded