mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/net/http.rb (Net::HTTP#get): A header hash given should not
be modified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
76731871e7
commit
0d375e732d
3 changed files with 12 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Wed Jan 5 13:56:54 2011 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
|
* lib/net/http.rb (Net::HTTP#get): A header hash given should not
|
||||||
|
be modified.
|
||||||
|
|
||||||
Wed Jan 5 13:56:03 2011 Aaron Patterson <aaron@tenderlovemaking.com>
|
Wed Jan 5 13:56:03 2011 Aaron Patterson <aaron@tenderlovemaking.com>
|
||||||
|
|
||||||
* SSL_shutdown should be called until the return value is non-zero:
|
* SSL_shutdown should be called until the return value is non-zero:
|
||||||
|
|
|
@ -987,7 +987,9 @@ module Net #:nodoc:
|
||||||
res = nil
|
res = nil
|
||||||
if HAVE_ZLIB
|
if HAVE_ZLIB
|
||||||
unless initheader.keys.any?{|k| k.downcase == "accept-encoding"}
|
unless initheader.keys.any?{|k| k.downcase == "accept-encoding"}
|
||||||
initheader["accept-encoding"] = "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
|
initheader = initheader.merge({
|
||||||
|
"accept-encoding" => "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
|
||||||
|
})
|
||||||
@compression = true
|
@compression = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -42,6 +42,10 @@ module TestNetHTTP_version_1_1_methods
|
||||||
assert_equal $test_net_http_data_type, res['Content-Type']
|
assert_equal $test_net_http_data_type, res['Content-Type']
|
||||||
assert_equal $test_net_http_data.size, res.body.size
|
assert_equal $test_net_http_data.size, res.body.size
|
||||||
assert_equal $test_net_http_data, res.body
|
assert_equal $test_net_http_data, res.body
|
||||||
|
|
||||||
|
assert_nothing_raised {
|
||||||
|
res, body = http.get('/', { 'User-Agent' => 'test' }.freeze)
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def _test_get__iter(http)
|
def _test_get__iter(http)
|
||||||
|
|
Loading…
Reference in a new issue