# HG changeset patch # User Sergey Kandaurov # Date 1407343001 -14400 # Node ID 37a46774e30742e2d67c9077a3a6b6f55985f7f5 # Parent 62d1f96c5ff40d4767638f46fe041fae00c7e7e9 Tests: entity tags test for unsuccessful response. Ensure that conditional request is ignored with otherwise unsuccessful response. diff --git a/not_modified.t b/not_modified.t --- a/not_modified.t +++ b/not_modified.t @@ -21,7 +21,7 @@ use Test::Nginx; select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has('http')->plan(14) +my $t = Test::Nginx->new()->has('http')->plan(15) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% @@ -94,6 +94,10 @@ like(http_get_im('/t', '"foo", "bar", ' like(http_get_im('/t', '*'), qr/200/, 'if-match all'); like(http_get_im('/t', 'W/' . $etag), qr/412/, 'if-match weak fail'); +# server MUST ignore precondition if its response wouldn't be 2xx or 412 + +like(http_get_im('/nx', '"foo"'), qr/404/, 'if-match ignored with 404'); + ############################################################################### sub http_get_ims {