diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-08-05 19:10:05 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-08-05 19:10:05 +0000 |
commit | c1652035644c5f52cd91cfb264df5072445f4020 () | |
tree | 4380446ef46174c9a75842bdfe0505102dec4894 /lib/net/http/generic_request.rb | |
parent | 159fa373f8e913a5464ab88c308e4375c946af8b (diff) |
* lib/net/http/generic_request.rb
(Net::HTTP::GenericRequest#update_uri): handle scheme, host, and port to reflect connection to @uri. * lib/net/http.rb (Net::HTTP#begin_transport): move trivial handling to Net::HTTP::GenericRequest#update_uri. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | lib/net/http/generic_request.rb | 33 |
1 files changed, 23 insertions, 10 deletions
@@ -136,21 +136,34 @@ class Net::HTTPGenericRequest end end - def update_uri(host, port, ssl) # :nodoc: return unless @uri - @uri.host ||= host - @uri.port = port - - scheme = ssl ? 'https' : 'http' # convert the class of the URI - unless scheme == @uri.scheme then - new_uri = @uri.to_s.sub(/^https?/, scheme) - @uri = URI new_uri end - - @uri end private |