@@ -22,7 +22,7 @@ use Test::Nginx qw/ :DEFAULT http_content /;
22
22
select STDERR ; $| = 1;
23
23
select STDOUT ; $| = 1;
24
24
25
- my $t = Test::Nginx-> new()-> has(qw/ http proxy upstream_keepalive/ )-> plan(4 );
25
+ my $t = Test::Nginx-> new()-> has(qw/ http proxy upstream_keepalive/ )-> plan(6 );
26
26
27
27
$t -> write_file_expand(' nginx.conf' , <<'EOF' );
28
28
@@ -54,6 +54,13 @@ http {
54
54
add_trailer X-Msec $msec;
55
55
}
56
56
57
+ location /unlimited {
58
+ proxy_pass http://127.0.0.1:8080/data;
59
+ proxy_limit_rate 0;
60
+ add_header X-Msec $msec;
61
+ add_trailer X-Msec $msec;
62
+ }
63
+
57
64
location /keepalive {
58
65
proxy_http_version 1.1;
59
66
proxy_set_header Connection "";
@@ -77,6 +84,13 @@ my ($body, $t1, $t2) = get('/');
77
84
cmp_ok($t2 - $t1 , ' >=' , 1, ' proxy_limit_rate' );
78
85
is($body , ' X' x 40000 , ' response body' );
79
86
87
+ # unlimited
88
+
89
+ ($body , $t1 , $t2 ) = get(' /unlimited' );
90
+
91
+ is($t2 - $t1 , 0, ' proxy_limit_rate unlimited' );
92
+ is($body , ' X' x 40000 , ' response body unlimited' );
93
+
80
94
# in case keepalive connection was saved with the delayed flag,
81
95
# the read timer used to be a delay timer in the next request
82
96
0 commit comments