1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/open-uri.rb (OpenURI.open_http): refine post_connection_check

call.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2005-07-01 03:49:12 +00:00
parent 70db83a8c3
commit f2a501261f
2 changed files with 13 additions and 3 deletions

View file

@ -243,10 +243,15 @@ module OpenURI
resp = nil
http.start {
if http.respond_to?(:verify_mode) &&
(http.verify_mode & OpenSSL::SSL::VERIFY_PEER) != 0
if target.class == URI::HTTPS
# xxx: information hiding violation
http.instance_variable_get(:@socket).io.post_connection_check(target_host)
sock = http.instance_variable_get(:@socket)
if sock.respond_to?(:io)
sock = sock.io # 1.9
else
sock = sock.instance_variable_get(:@socket) # 1.8
end
sock.post_connection_check(target_host)
end
req = Net::HTTP::Get.new(request_uri, header)
if options.include? :http_basic_authentication