Mercurial > hg > nginx-tests
comparison not_modified.t @ 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 | f5f2a66853a9 |
children | d5bf5942a8b2 |
comparison
equal
deleted
inserted
replaced
445:62d1f96c5ff4 | 446:37a46774e307 |
---|---|
19 ############################################################################### | 19 ############################################################################### |
20 | 20 |
21 select STDERR; $| = 1; | 21 select STDERR; $| = 1; |
22 select STDOUT; $| = 1; | 22 select STDOUT; $| = 1; |
23 | 23 |
24 my $t = Test::Nginx->new()->has('http')->plan(14) | 24 my $t = Test::Nginx->new()->has('http')->plan(15) |
25 ->write_file_expand('nginx.conf', <<'EOF'); | 25 ->write_file_expand('nginx.conf', <<'EOF'); |
26 | 26 |
27 %%TEST_GLOBALS%% | 27 %%TEST_GLOBALS%% |
28 | 28 |
29 daemon off; | 29 daemon off; |
92 like(http_get_im('/t', '"foo", "bar", ' . "\t" . $etag . ' , "baz"'), | 92 like(http_get_im('/t', '"foo", "bar", ' . "\t" . $etag . ' , "baz"'), |
93 qr/200/, 'if-match with complex list'); | 93 qr/200/, 'if-match with complex list'); |
94 like(http_get_im('/t', '*'), qr/200/, 'if-match all'); | 94 like(http_get_im('/t', '*'), qr/200/, 'if-match all'); |
95 like(http_get_im('/t', 'W/' . $etag), qr/412/, 'if-match weak fail'); | 95 like(http_get_im('/t', 'W/' . $etag), qr/412/, 'if-match weak fail'); |
96 | 96 |
97 # server MUST ignore precondition if its response wouldn't be 2xx or 412 | |
98 | |
99 like(http_get_im('/nx', '"foo"'), qr/404/, 'if-match ignored with 404'); | |
100 | |
97 ############################################################################### | 101 ############################################################################### |
98 | 102 |
99 sub http_get_ims { | 103 sub http_get_ims { |
100 my ($url, $ims) = @_; | 104 my ($url, $ims) = @_; |
101 return http(<<EOF); | 105 return http(<<EOF); |