changeset 446:37a46774e307

Tests: entity tags test for unsuccessful response. Ensure that conditional request is ignored with otherwise unsuccessful response.
author Sergey Kandaurov <pluknet@nginx.com>
date Wed, 06 Aug 2014 20:36:41 +0400
parents 62d1f96c5ff4
children 183f21bbe3d6
files not_modified.t
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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 {