diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-08-05 19:10:23 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-08-05 19:10:23 +0000 |
commit | 70a2eb63999265ff7e8d46d1f5b410c8ee3d30d7 (patch) | |
tree | 15a61f57c435ea95ddf51cf96dda46e4a6ea2752 /lib/net/http/generic_request.rb | |
parent | c1652035644c5f52cd91cfb264df5072445f4020 (diff) | |
download | ruby-70a2eb63999265ff7e8d46d1f5b410c8ee3d30d7.tar.gz |
* lib/net/http/generic_request.rb (Net::HTTP::GenericRequest#exec):
handle req['host'] in update_uri.
* lib/net/http/generic_request.rb
(Net::HTTP::GenericRequest#update_uri):
use req['host'] if it is explicitly set. Even if URI is given,
it is already used for the initial value of req['host'].
Therefore overwritten value should be respected. [Bug #10054]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net/http/generic_request.rb')
-rw-r--r-- | lib/net/http/generic_request.rb | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/net/http/generic_request.rb b/lib/net/http/generic_request.rb index f410d5838e..00ff434ccf 100644 --- a/lib/net/http/generic_request.rb +++ b/lib/net/http/generic_request.rb @@ -116,15 +116,6 @@ class Net::HTTPGenericRequest # def exec(sock, ver, path) #:nodoc: internal use only - if @uri - if @uri.port == @uri.default_port - # [Bug #7650] Amazon ECS API and GFE/1.3 disallow extra default port number - self['host'] = @uri.host - else - self['host'] = "#{@uri.host}:#{@uri.port}" - end - end - if @body send_request_with_body sock, ver, path, @body elsif @body_stream @@ -148,9 +139,9 @@ class Net::HTTPGenericRequest klass = URI::HTTP end - if host = @uri.host - elsif host = self['host'] + if host = self['host'] host.sub!(/:.*/s, ''.freeze) + elsif host = @uri.host else host = addr end |