# HG changeset patch # User Sergey Kandaurov # Date 1504015434 -10800 # Node ID 0469ef3fcd34b804327c82717a1b97c18d4ca500 # Parent 0c15ba7d19b3a845ba5943f909dadfb6fdf432c0 Tests: added "expires modified" test with proxy. diff --git a/headers.t b/headers.t --- a/headers.t +++ b/headers.t @@ -23,7 +23,7 @@ use Test::Nginx; 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 @@ http { location /modified { expires modified 2048; + + location /modified/proxy { + proxy_pass http://127.0.0.1:8081/modified; + } } location /var { @@ -96,6 +100,13 @@ http { } } } + + 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('/negative'), qr/no-cache/ 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');