Tests: added slice filter test for original Accept-Ranges.
diff --git a/slice.t b/slice.t index 3bab3bc..841d285 100644 --- a/slice.t +++ b/slice.t
@@ -23,7 +23,7 @@ select STDOUT; $| = 1; my $t = Test::Nginx->new()->has(qw/http proxy cache fastcgi slice rewrite/) - ->plan(76); + ->plan(79); $t->write_file_expand('nginx.conf', <<'EOF'); @@ -109,6 +109,8 @@ listen 127.0.0.1:8081; server_name localhost; + add_header Accept-Ranges bytes; + location / { if ($http_range = "") { set $limit_rate 100; @@ -129,6 +131,17 @@ like(http_get('/cache/nx'), qr/ 404 /, 'not found'); like(http_get('/cache/t'), qr/ 200 .*0123456789abcdef$/ms, 'no range'); +$r = get('/proxy/t', 'Range: bytes=3-4'); +like($r, qr/ 206 /, 'proxy - 206 partial reply'); +like($r, qr/^34$/m, 'proxy - correct content'); + +TODO: { +local $TODO = 'not yet' unless $t->has_version('1.19.2'); + +unlike($r, qr/Accept-Ranges/, 'proxy - no original accept-ranges'); + +} + $r = get('/cache/t?single', "Range: bytes=0-0"); like($r, qr/ 206 /, 'single - 206 partial reply'); like($r, qr/^0$/m, 'single - correct content');