mirror of
https://github.com/lostisland/faraday.git
synced 2025-10-06 00:03:36 -04:00
don't override excon's global connection settings
Update excon's settings on the connection instance, not globally for all connections (even ones made outside of faraday). Address deprecation warnings.
This commit is contained in:
parent
6c0b3b1bbe
commit
24ced570ed
2
Gemfile
2
Gemfile
@ -7,7 +7,7 @@ end
|
||||
group :test do
|
||||
gem 'em-http-request', '~> 1.0', :require => 'em-http'
|
||||
gem 'em-synchrony', '~> 1.0', :require => ['em-synchrony', 'em-synchrony/em-http'], :platforms => :ruby_19
|
||||
gem 'excon', '~> 0.6'
|
||||
gem 'excon', '~> 0.9', '> 0.9.6'
|
||||
gem 'httpclient', '~> 2.2'
|
||||
gem 'net-http-persistent', '~> 2.5', :require => false
|
||||
gem 'leftright', '~> 0.9', :require => false
|
||||
|
@ -6,11 +6,12 @@ module Faraday
|
||||
def call(env)
|
||||
super
|
||||
|
||||
conn = ::Excon.new(env[:url].to_s)
|
||||
opts = {}
|
||||
if env[:url].scheme == 'https' && ssl = env[:ssl]
|
||||
::Excon.ssl_verify_peer = !!ssl.fetch(:verify, true)
|
||||
::Excon.ssl_ca_path = ssl[:ca_file] if ssl[:ca_file]
|
||||
opts[:ssl_verify_peer] = !!ssl.fetch(:verify, true)
|
||||
opts[:ssl_ca_path] = ssl[:ca_file] if ssl[:ca_file]
|
||||
end
|
||||
conn = ::Excon.new(env[:url].to_s, opts)
|
||||
|
||||
resp = conn.request \
|
||||
:method => env[:method].to_s.upcase,
|
||||
|
Loading…
x
Reference in New Issue
Block a user