* lib/net/http.rb (Net::HTTP.get_response): enable use_ssl

if given URI object is https.
  patched by Mark Ferlatte [ruby-core:40665] [Bug #5545]

* lib/net/http.rb (Net::HTTP.post_form): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2011-11-26 11:44:45 +00:00
Родитель 9d4db2d4d9
Коммит 708d76a3b1
2 изменённых файлов: 12 добавлений и 2 удалений

Просмотреть файл

@ -1,3 +1,11 @@
Sat Nov 26 20:41:48 2011 NARUSE, Yui <naruse@ruby-lang.org>
* lib/net/http.rb (Net::HTTP.get_response): enable use_ssl
if given URI object is https.
patched by Mark Ferlatte [ruby-core:40665] [Bug #5545]
* lib/net/http.rb (Net::HTTP.post_form): ditto.
Sat Nov 26 20:01:18 2011 NARUSE, Yui <naruse@ruby-lang.org>
* lib/net/http.rb (Net::HTTP::SSL_ATTRIBUTES): refix 33701.

Просмотреть файл

@ -451,7 +451,8 @@ module Net #:nodoc:
}
else
uri = uri_or_host
new(uri.hostname, uri.port).start {|http|
start(uri.hostname, uri.port,
:use_ssl => uri.scheme == 'https') {|http|
return http.request_get(uri.request_uri, &block)
}
end
@ -479,7 +480,8 @@ module Net #:nodoc:
req = Post.new(url.request_uri)
req.form_data = params
req.basic_auth url.user, url.password if url.user
new(url.hostname, url.port).start {|http|
start(url.hostname, url.port,
:use_ssl => uri.scheme == 'https' ) {|http|
http.request(req)
}
end