changeset 1474:f026c41335b2

Tests: range filter and chunked transfer encoding test.
author Sergey Kandaurov <pluknet@nginx.com>
date Mon, 13 May 2019 21:06:25 +0300
parents ddbde6c5b0cd
children 86510f795546
files proxy_force_ranges.t
diffstat 1 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/proxy_force_ranges.t
+++ b/proxy_force_ranges.t
@@ -13,6 +13,8 @@ use strict;
 
 use Test::More;
 
+use Socket qw/ $CRLF /;
+
 BEGIN { use FindBin; chdir($FindBin::Bin); }
 
 use lib 'lib';
@@ -23,7 +25,7 @@ use Test::Nginx;
 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 @@ http {
         location /proxy/ {
             proxy_pass    http://127.0.0.1:8081/;
             proxy_force_ranges on;
+            add_trailer X-Trailer "";
         }
 
         location /cache/ {
@@ -104,6 +107,16 @@ like(http_get_range('/proxy/t.html',
 	"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 {