Mercurial > hg > nginx-tests
changeset 1212:0469ef3fcd34
Tests: added "expires modified" test with proxy.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Tue, 29 Aug 2017 17:03:54 +0300 |
parents | 0c15ba7d19b3 |
children | 64f287c8cc62 |
files | headers.t |
diffstat | 1 files changed, 22 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/headers.t Tue Aug 29 16:56:52 2017 +0300 +++ b/headers.t Tue Aug 29 17:03:54 2017 +0300 @@ -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');