about summary refs log tree commit homepage
path: root/test/test_output_buffering.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-07-26 23:54:54 +0000
committerEric Wong <e@80x24.org>2016-07-26 23:54:54 +0000
commite138d022e98b66c535f9bbdb230e4b5087fd8f33 (patch)
treeffeec5891d2b3c1c7b623970a402ea2723fe2805 /test/test_output_buffering.rb
parent4d5c57d62e603cbadf6b896489ae49bb197b6fe8 (diff)
downloadyahns-e138d022e98b66c535f9bbdb230e4b5087fd8f33.tar.gz
rack 2.x has some incompatible changes an deprecations; support
it but remain compatible with rack 1.x for the next few years.
Diffstat (limited to 'test/test_output_buffering.rb')
-rw-r--r--test/test_output_buffering.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/test_output_buffering.rb b/test/test_output_buffering.rb
index da93b87..ba3e94a 100644
--- a/test/test_output_buffering.rb
+++ b/test/test_output_buffering.rb
@@ -126,7 +126,10 @@ class TestOutputBuffering < Testcase
           end
           size = gplv3.size
           len = size.to_s
-          ranges = Rack::Utils.byte_ranges(e, size)
+
+          ranges = Rack::Utils.respond_to?(:get_byte_ranges) ?
+                   Rack::Utils.get_byte_ranges(e['HTTP_RANGE'], size) :
+                   Rack::Utils.byte_ranges(e, size)
           status = 200
           h = { "Content-Type" => "text/plain", "Content-Length" => len }
           if ranges && ranges.size == 1