summaryrefslogtreecommitdiff
path: root/lib/net
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-26 11:44:45 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-26 11:44:45 +0000
commit708d76a3b1ab9d5b888a9e68773406e289860aa0 (patch)
tree1b461d5c44c7af276720345e997d7070d52c05da /lib/net
parent9d4db2d4d9549d5547c50d8049c4448d10816651 (diff)
* 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
Diffstat (limited to 'lib/net')
-rw-r--r--lib/net/http.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb
index 2fd81e0d2c..c383f206d3 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -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