Tests: range filter and chunked transfer encoding test.
diff --git a/proxy_force_ranges.t b/proxy_force_ranges.t
index 178fce0..00aaf93 100644
--- a/proxy_force_ranges.t
+++ b/proxy_force_ranges.t
@@ -13,6 +13,8 @@
use Test::More;
+use Socket qw/ $CRLF /;
+
BEGIN { use FindBin; chdir($FindBin::Bin); }
use lib 'lib';
@@ -23,7 +25,7 @@
select STDERR; $| = 1;
select STDOUT; $| = 1;
-my $t = Test::Nginx->new()->has(qw/http proxy cache/)->plan(6)
+my $t = Test::Nginx->new()->has(qw/http proxy cache/)->plan(7)
->write_file_expand('nginx.conf', <<'EOF');
%%TEST_GLOBALS%%
@@ -50,6 +52,7 @@
location /proxy/ {
proxy_pass http://127.0.0.1:8081/;
proxy_force_ranges on;
+ add_trailer X-Trailer "";
}
location /cache/ {
@@ -104,6 +107,16 @@
"Range: bytes=4-\nIf-Range: \"59a5401c-8\""),
qr/^THIS/m, 'if-range etag proxy');
+# range sent using chunked transfer encoding
+
+TODO: {
+local $TODO = 'not yet';
+
+like(http_get_range('/proxy/t.html', 'Range: bytes=-2'),
+ qr/2${CRLF}IS${CRLF}0$CRLF$CRLF$/, 'no dublicate final chunk');
+
+}
+
###############################################################################
sub http_get_range {