Tests: added "expires modified" test with proxy.
diff --git a/headers.t b/headers.t
index e3459e3..4e9c7c8 100644
--- a/headers.t
+++ b/headers.t
@@ -23,7 +23,7 @@
select STDERR; $| = 1;
select STDOUT; $| = 1;
-my $t = Test::Nginx->new()->has(qw/http/)->plan(27)
+my $t = Test::Nginx->new()->has(qw/http proxy/)->plan(28)
->write_file_expand('nginx.conf', <<'EOF');
%%TEST_GLOBALS%%
@@ -82,6 +82,10 @@
location /modified {
expires modified 2048;
+
+ location /modified/proxy {
+ proxy_pass http://127.0.0.1:8081/modified;
+ }
}
location /var {
@@ -96,6 +100,13 @@
}
}
}
+
+ server {
+ listen 127.0.0.1:8081;
+ server_name localhost;
+
+ add_header Last-Modified "Mon, 28 Sep 1970 06:00:00 GMT";
+ }
}
EOF
@@ -144,6 +155,16 @@
like(http_get('/daily'), qr/Expires:.*:33 GMT/, 'expires daily');
like(http_get('/modified'), qr/max-age=204./, 'expires modified');
+# "expires modified" with proxy
+
+TODO: {
+local $TODO = 'not yet' unless $t->has_version('1.13.5');
+
+like(http_get('/modified/proxy'), qr/Expires: Mon, 28 Sep 1970 06:34:08 GMT/,
+ 'expires modified proxy');
+
+}
+
# expires with variables
like(http_get('/var?e=epoch'), qr/Expires:.*1970/, 'expires var epoch');