mirror of
https://github.com/lostisland/faraday.git
synced 2025-10-17 00:05:28 -04:00
Duplicate SSL settings on #dup call
This commit is contained in:
parent
194f06be24
commit
29bfde444b
@ -237,7 +237,7 @@ module Faraday
|
|||||||
end
|
end
|
||||||
|
|
||||||
def dup
|
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
|
end
|
||||||
|
|
||||||
def proxy_arg_to_uri(arg)
|
def proxy_arg_to_uri(arg)
|
||||||
|
@ -238,15 +238,16 @@ class TestConnection < Faraday::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_dups_connection_object
|
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
|
b.adapter :net_http
|
||||||
end
|
end
|
||||||
conn.headers['content-type'] = 'text/plain'
|
conn.headers['content-type'] = 'text/plain'
|
||||||
conn.params['a'] = '1'
|
conn.params['a'] = '1'
|
||||||
|
|
||||||
duped = conn.dup
|
duped = conn.dup
|
||||||
|
|
||||||
assert_equal conn.build_url(''), duped.build_url('')
|
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_equal conn.send(attr), duped.send(attr)
|
||||||
assert_not_equal conn.send(attr).object_id, duped.send(attr).object_id
|
assert_not_equal conn.send(attr).object_id, duped.send(attr).object_id
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user