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:
parent
70db83a8c3
commit
f2a501261f
2 changed files with 13 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue