Skip to content

Commit 7b90061

Browse files
committed
Tests: added "expires modified" test with proxy.
1 parent 999ee0d commit 7b90061

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

headers.t

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

26-
my $t = Test::Nginx->new()->has(qw/http/)->plan(27)
26+
my $t = Test::Nginx->new()->has(qw/http proxy/)->plan(28)
2727
->write_file_expand('nginx.conf', <<'EOF');
2828
2929
%%TEST_GLOBALS%%
@@ -82,6 +82,10 @@ http {
8282
8383
location /modified {
8484
expires modified 2048;
85+
86+
location /modified/proxy {
87+
proxy_pass http://127.0.0.1:8081/modified;
88+
}
8589
}
8690
8791
location /var {
@@ -96,6 +100,13 @@ http {
96100
}
97101
}
98102
}
103+
104+
server {
105+
listen 127.0.0.1:8081;
106+
server_name localhost;
107+
108+
add_header Last-Modified "Mon, 28 Sep 1970 06:00:00 GMT";
109+
}
99110
}
100111
101112
EOF
@@ -144,6 +155,16 @@ like(http_get('/negative'), qr/no-cache/, 'expires negative');
144155
like(http_get('/daily'), qr/Expires:.*:33 GMT/, 'expires daily');
145156
like(http_get('/modified'), qr/max-age=204./, 'expires modified');
146157

158+
# "expires modified" with proxy
159+
160+
TODO: {
161+
local $TODO = 'not yet' unless $t->has_version('1.13.5');
162+
163+
like(http_get('/modified/proxy'), qr/Expires: Mon, 28 Sep 1970 06:34:08 GMT/,
164+
'expires modified proxy');
165+
166+
}
167+
147168
# expires with variables
148169

149170
like(http_get('/var?e=epoch'), qr/Expires:.*1970/, 'expires var epoch');

0 commit comments

Comments
 (0)