1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Refix r36678: switch with zlib and check content-encoding.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2012-08-10 10:53:18 +00:00
parent 89c88eb5a9
commit ccf911a02d

View file

@ -92,8 +92,14 @@ EOS
body = res.read_body
end
assert_equal 'hello', body
end if Net::HTTP::HAVE_ZLIB
if Net::HTTP::HAVE_ZLIB
assert_equal nil, res['content-encoding']
assert_equal 'hello', body
else
assert_equal 'deflate', res['content-encoding']
assert_equal "x\x9C\xCBH\xCD\xC9\xC9\a\x00\x06,\x02\x15", body
end
end
def test_read_body_content_encoding_deflate_chunked
io = dummy_io(<<EOS)
@ -118,8 +124,14 @@ EOS
body = res.read_body
end
assert_equal 'hello', body
end if Net::HTTP::HAVE_ZLIB
if Net::HTTP::HAVE_ZLIB
assert_equal nil, res['content-encoding']
assert_equal 'hello', body
else
assert_equal 'deflate', res['content-encoding']
assert_equal "x\x9C\xCBH\xCD\xC9\xC9\a\x00\x06,\x02\x15", body
end
end
def test_read_body_content_encoding_deflate_no_length
io = dummy_io(<<EOS)
@ -138,8 +150,14 @@ EOS
body = res.read_body
end
assert_equal 'hello', body
end if Net::HTTP::HAVE_ZLIB
if Net::HTTP::HAVE_ZLIB
assert_equal nil, res['content-encoding']
assert_equal 'hello', body
else
assert_equal 'deflate', res['content-encoding']
assert_equal "x\x9C\xCBH\xCD\xC9\xC9\a\x00\x06,\x02\x15\r\n", body
end
end
def test_read_body_content_encoding_deflate_content_range
io = dummy_io(<<EOS)