[前][次][番号順一覧][スレッド一覧]

ruby-changes:26657

From: naruse <ko1@a...>
Date: Sun, 6 Jan 2013 00:05:02 +0900 (JST)
Subject: [ruby-changes:26657] naruse:r38707 (trunk): * lib/net/http/generic_request.rb:

naruse	2013-01-06 00:04:48 +0900 (Sun, 06 Jan 2013)

  New Revision: 38707

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38707

  Log:
    * 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]

  Modified files:
    trunk/ChangeLog
    trunk/lib/net/http/generic_request.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 38706)
+++ ChangeLog	(revision 38707)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Jan  5 21:15:10 2013  NARUSE, Yui  <naruse@r...>
+
+	* 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  <drbrain@s...>
 
 	* doc/syntax/modules_and_classes.rdoc:  Improved description of methods
Index: lib/net/http/generic_request.rb
===================================================================
--- lib/net/http/generic_request.rb	(revision 38706)
+++ lib/net/http/generic_request.rb	(revision 38707)
@@ -99,7 +99,14 @@ class Net::HTTPGenericRequest https://github.com/ruby/ruby/blob/trunk/lib/net/http/generic_request.rb#L99
   #
 
   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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]