mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1f9fa7c62f
commit
023561f704
3 changed files with 8 additions and 7 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Sun Feb 24 15:14:43 2013 Eric Hodel <drbrain@segment7.net>
|
||||||
|
|
||||||
|
* 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@zacharyscott.net>
|
Wed Feb 20 14:28:00 2013 Zachary Scott <zachary@zacharyscott.net>
|
||||||
|
|
||||||
* thread.c: Document ThreadGroup::Default
|
* thread.c: Document ThreadGroup::Default
|
||||||
|
|
|
@ -1122,13 +1122,6 @@ module Net #:nodoc:
|
||||||
#
|
#
|
||||||
def get(path, initheader = {}, dest = nil, &block) # :yield: +body_segment+
|
def get(path, initheader = {}, dest = nil, &block) # :yield: +body_segment+
|
||||||
res = nil
|
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|
|
request(Get.new(path, initheader)) {|r|
|
||||||
r.read_body dest, &block
|
r.read_body dest, &block
|
||||||
res = r
|
res = r
|
||||||
|
|
|
@ -232,6 +232,8 @@ module TestNetHTTP_version_1_1_methods
|
||||||
assert_nothing_raised {
|
assert_nothing_raised {
|
||||||
http.get('/', { 'User-Agent' => 'test' }.freeze)
|
http.get('/', { 'User-Agent' => 'test' }.freeze)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert res.decode_content, '[Bug #7924]'
|
||||||
end
|
end
|
||||||
|
|
||||||
def _test_get__iter(http)
|
def _test_get__iter(http)
|
||||||
|
|
Loading…
Add table
Reference in a new issue