Bug #7924 » net.http.bug7924.patch
lib/net/http.rb (working copy) | ||
---|---|---|
#
|
||
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
|
test/net/http/test_http.rb (working copy) | ||
---|---|---|
assert_nothing_raised {
|
||
http.get('/', { 'User-Agent' => 'test' }.freeze)
|
||
}
|
||
assert res.decode_content, '[Bug #7924]'
|
||
end
|
||
def _test_get__iter(http)
|