aboutsummaryrefslogtreecommitdiffstats
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
parent9d4db2d4d9549d5547c50d8049c4448d10816651 (diff)
downloadruby-708d76a3b1ab9d5b888a9e68773406e289860aa0.tar.gz
* 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
-rw-r--r--ChangeLog8
-rw-r--r--lib/net/http.rb6
2 files changed, 12 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index de7fcd93c6..19a09d0c25 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
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