diff options
author | Eric Wong <e@80x24.org> | 2016-07-26 23:54:54 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-07-26 23:54:54 +0000 |
commit | e138d022e98b66c535f9bbdb230e4b5087fd8f33 (patch) | |
tree | ffeec5891d2b3c1c7b623970a402ea2723fe2805 /test/test_output_buffering.rb | |
parent | 4d5c57d62e603cbadf6b896489ae49bb197b6fe8 (diff) | |
download | yahns-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.rb | 5 |
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 |