merge revision(s) 39232,39233,39238: [Backport #7831][Backport #7852]

* lib/net/http:  Do not handle Content-Encoding when the user sets
	  Accept-Encoding.  This allows users to handle Content-Encoding for
	  themselves.  This restores backwards-compatibility with Ruby 1.x.

	* lib/net/http/generic_request.rb:  ditto.

	* lib/net/http/response.rb:  ditto

	* test/net/http/test_http.rb:  Test for the above.

	* test/net/http/test_http_request.rb:  ditto.

	* test/net/http/test_httpresponse.rb:  ditto.
	  [ruby-trunk - Bug #7831]

	* lib/net/http.rb:  Removed OpenSSL dependency from Net::HTTP.

	* test/net/http/test_http.rb:  Remove Zlib dependency from tests.

	* test/net/http/test_http_request.rb:  ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@39244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2013-02-14 15:51:45 +00:00
parent aea2c7ca50
commit ddddf044b2
8 changed files with 117 additions and 3 deletions

View file

@ -53,5 +53,27 @@ class HTTPRequestTest < Test::Unit::TestCase
assert_equal expected, req.to_hash
end
def test_initialize_accept_encoding
req1 = Net::HTTP::Get.new '/'
assert req1.decode_content, 'Bug #7831 - automatically decode content'
req2 = Net::HTTP::Get.new '/', 'accept-encoding' => 'identity'
refute req2.decode_content,
'Bug #7381 - do not decode content if the user overrides'
end if Net::HTTP::HAVE_ZLIB
def test_header_set
req = Net::HTTP::Get.new '/'
assert req.decode_content, 'Bug #7831 - automatically decode content'
req['accept-encoding'] = 'identity'
refute req.decode_content,
'Bug #7831 - do not decode content if the user overrides'
end if Net::HTTP::HAVE_ZLIB
end