From a1de1fa575786655f5c9960d4b8dcb8db695ccf4 Mon Sep 17 00:00:00 2001 From: naruse Date: Sat, 5 Jan 2013 15:04:48 +0000 Subject: [PATCH] * lib/net/http/generic_request.rb: Amazon ECA API and GTE/1.3 disallow requests whose host has port number if its port number equlas to default port number of the scheme. [Bug #7650] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ lib/net/http/generic_request.rb | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e44610b61f..7f43728324 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Sat Jan 5 21:15:10 2013 NARUSE, Yui + + * lib/net/http/generic_request.rb: + Amazon ECA API and GTE/1.3 disallow requests whose host has port + number if its port number equlas to default port number of the + scheme. [Bug #7650] + Sat Jan 5 13:58:59 2013 Eric Hodel * doc/syntax/modules_and_classes.rdoc: Improved description of methods diff --git a/lib/net/http/generic_request.rb b/lib/net/http/generic_request.rb index e8525b3d15..568131fe8d 100644 --- a/lib/net/http/generic_request.rb +++ b/lib/net/http/generic_request.rb @@ -99,7 +99,14 @@ class Net::HTTPGenericRequest # def exec(sock, ver, path) #:nodoc: internal use only - self['host'] = "#{@uri.host}:#{@uri.port}" if @uri + 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