Skip to content

Commit af39716

Browse files
committed
Tests: test for upstream Cache-Control max-age overflowing value.
1 parent a737858 commit af39716

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

proxy_cache_control.t

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use Test::Nginx;
2222
select STDERR; $| = 1;
2323
select STDOUT; $| = 1;
2424

25-
my $t = Test::Nginx->new()->has(qw/http proxy cache rewrite/)->plan(19);
25+
my $t = Test::Nginx->new()->has(qw/http proxy cache rewrite/)->plan(20);
2626

2727
$t->write_file_expand('nginx.conf', <<'EOF');
2828
@@ -74,6 +74,12 @@ http {
7474
return 204;
7575
}
7676
77+
location /cache-control-overflow {
78+
# sufficiently large for 32-bit and 64-bit representations
79+
add_header Cache-Control max-age=9223372036854775808;
80+
return 204;
81+
}
82+
7783
location /x-accel-expires {
7884
add_header X-Accel-Expires 60;
7985
return 204;
@@ -191,6 +197,14 @@ $t->run();
191197

192198
like(get('/expires'), qr/HIT/, 'expires');
193199
like(get('/cache-control'), qr/HIT/, 'cache-control');
200+
201+
TODO: {
202+
local $TODO = 'not yet' unless $t->has_version('1.29.2');
203+
204+
like(get('/cache-control-overflow'), qr/HIT/, 'cache-control overflow');
205+
206+
}
207+
194208
like(get('/x-accel-expires'), qr/HIT/, 'x-accel-expires');
195209
like(get('/x-accel-expires-at'), qr/EXPIRED/, 'x-accel-expires at');
196210

0 commit comments

Comments
 (0)