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

ruby-changes:27411

From: drbrain <ko1@a...>
Date: Sun, 24 Feb 2013 15:15:18 +0900 (JST)
Subject: [ruby-changes:27411] drbrain:r39463 (trunk): * lib/net/http.rb: Removed duplicate Accept-Encoding in Net::HTTP#get.

drbrain	2013-02-24 15:15:05 +0900 (Sun, 24 Feb 2013)

  New Revision: 39463

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

  Log:
    * lib/net/http.rb:  Removed duplicate Accept-Encoding in Net::HTTP#get.
      [ruby-trunk - Bug #7924]
    * test/net/http/test_http.rb:  Test for the above.

  Modified files:
    trunk/ChangeLog
    trunk/lib/net/http.rb
    trunk/test/net/http/test_http.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 39462)
+++ ChangeLog	(revision 39463)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Feb 24 15:14:43 2013  Eric Hodel  <drbrain@s...>
+
+	* lib/net/http.rb:  Removed duplicate Accept-Encoding in Net::HTTP#get.
+	  [ruby-trunk - Bug #7924]
+	* test/net/http/test_http.rb:  Test for the above.
+
 Wed Feb 20 14:28:00 2013  Zachary Scott  <zachary@z...>
 
 	* thread.c: Document ThreadGroup::Default
Index: lib/net/http.rb
===================================================================
--- lib/net/http.rb	(revision 39462)
+++ lib/net/http.rb	(revision 39463)
@@ -1122,13 +1122,6 @@ module Net   #:nodoc: https://github.com/ruby/ruby/blob/trunk/lib/net/http.rb#L1122
     #
     def get(path, initheader = {}, dest = nil, &block) # :yield: +body_segment+
       res = nil
-      if HAVE_ZLIB
-        unless  initheader.keys.any?{|k| k.downcase == "accept-encoding"}
-          initheader = initheader.merge({
-            "accept-encoding" => "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
-          })
-        end
-      end
       request(Get.new(path, initheader)) {|r|
         r.read_body dest, &block
         res = r
Index: test/net/http/test_http.rb
===================================================================
--- test/net/http/test_http.rb	(revision 39462)
+++ test/net/http/test_http.rb	(revision 39463)
@@ -232,6 +232,8 @@ module TestNetHTTP_version_1_1_methods https://github.com/ruby/ruby/blob/trunk/test/net/http/test_http.rb#L232
     assert_nothing_raised {
       http.get('/', { 'User-Agent' => 'test' }.freeze)
     }
+
+    assert res.decode_content, '[Bug #7924]'
   end
 
   def _test_get__iter(http)

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

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