# HG changeset patch # User Maxim Dounin # Date 1418218792 -10800 # Node ID 1e0818200b3fef10f74a7a4891689d1350392949 # Parent 4892d701d558c9b4c28da9137f6159d4eb887874 Tests: various expires variants. diff --git a/headers.t b/headers.t --- a/headers.t +++ b/headers.t @@ -48,13 +48,49 @@ http { location /nx { } + + location /epoch { + expires epoch; + } + + location /max { + expires max; + } + + location /off { + expires off; + } + + location /access { + expires 2048; + } + + location /negative { + expires -2048; + } + + location /daily { + expires @15h30m33s; + } + + location /modified { + expires modified 2048; + } } } EOF $t->write_file('t1', ''); -$t->try_run('no add_header always')->plan(6); +$t->write_file('epoch', ''); +$t->write_file('max', ''); +$t->write_file('off', ''); +$t->write_file('access', ''); +$t->write_file('negative', ''); +$t->write_file('daily', ''); +$t->write_file('modified', ''); + +$t->try_run('no add_header always')->plan(13); ############################################################################### @@ -72,4 +108,14 @@ unlike($r, qr/Cache-Control/, 'bad expir unlike($r, qr/X-URI/, 'bad add_header'); like($r, qr/X-Always/, 'bad add_header always'); +# various expires variants + +like(http_get('/epoch'), qr/Expires:.*1970/, 'expires epoch'); +like(http_get('/max'), qr/Expires:.*2037/, 'expires max'); +unlike(http_get('/off'), qr/Expires:/, 'expires off'); +like(http_get('/access'), qr/max-age=2048/, 'expires access'); +like(http_get('/negative'), qr/no-cache/, 'expires negative'); +like(http_get('/daily'), qr/Expires:.*:33 GMT/, 'expires daily'); +like(http_get('/modified'), qr/max-age=2048/, 'expires modified'); + ###############################################################################