From cc35c03c3cf8791d00d526eebc2fa5d5f748aec1 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Thu, 25 Feb 2021 21:42:59 -0500 Subject: [core] RFC 7233 Range handling for non-streaming RFC 7233 Range handling for all non-streaming responses, including (non-streaming) dynamic responses (previously Range responses handled only for static files) --- tests/request.t | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'tests/request.t') diff --git a/tests/request.t b/tests/request.t index bba4b938..432bb51e 100755 --- a/tests/request.t +++ b/tests/request.t @@ -8,7 +8,7 @@ BEGIN { use strict; use IO::Socket; -use Test::More tests => 53; +use Test::More tests => 54; use LightyTest; my $tf = LightyTest->new(); @@ -300,15 +300,14 @@ Range: bytes=0-1,97-98 EOF ); $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 206, 'HTTP-Content' => <handle_http($t) == 0, 'GET, Range 0-1,97-98 (ranges not merged)'); +$t->{REQUEST} = ( <{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 206, 'Content-Range' => 'bytes 0-5/6' } ]; +ok($tf->handle_http($t) == 0, 'GET, Range 0-'); + $t->{REQUEST} = ( <{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } ]; +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 416 } ]; ok($tf->handle_http($t) == 0, 'GET, Range 0--'); $t->{REQUEST} = ( <{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } ]; +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 416 } ]; ok($tf->handle_http($t) == 0, 'GET, Range -2-3'); $t->{REQUEST} = ( <