mirror of
https://github.com/lostisland/faraday.git
synced 2025-08-30 00:03:09 -04:00
Duplicate SSL settings on #dup call
This commit is contained in:
parent
194f06be24
commit
29bfde444b
@ -237,7 +237,7 @@ module Faraday
|
||||
end
|
||||
|
||||
def dup
|
||||
self.class.new(build_url(''), :headers => headers.dup, :params => params.dup, :builder => builder.dup)
|
||||
self.class.new(build_url(''), :headers => headers.dup, :params => params.dup, :builder => builder.dup, :ssl => ssl.dup)
|
||||
end
|
||||
|
||||
def proxy_arg_to_uri(arg)
|
||||
|
@ -238,15 +238,16 @@ class TestConnection < Faraday::TestCase
|
||||
end
|
||||
|
||||
def test_dups_connection_object
|
||||
conn = Faraday::Connection.new 'http://sushi.com/foo' do |b|
|
||||
conn = Faraday::Connection.new 'http://sushi.com/foo', :ssl => { :verify => :none } do |b|
|
||||
b.adapter :net_http
|
||||
end
|
||||
conn.headers['content-type'] = 'text/plain'
|
||||
conn.params['a'] = '1'
|
||||
|
||||
duped = conn.dup
|
||||
|
||||
assert_equal conn.build_url(''), duped.build_url('')
|
||||
[:headers, :params, :builder].each do |attr|
|
||||
[:headers, :params, :builder, :ssl].each do |attr|
|
||||
assert_equal conn.send(attr), duped.send(attr)
|
||||
assert_not_equal conn.send(attr).object_id, duped.send(attr).object_id
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user