Mercurial > hg > nginx-tests
comparison not_modified.t @ 416:5c25acbc870a
Tests: etags support is present in all supported branches.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Sun, 22 Jun 2014 22:13:57 +0400 |
parents | 6a0d934950bc |
children | 1bdd58f388f6 |
comparison
equal
deleted
inserted
replaced
415:020c4e47ecac | 416:5c25acbc870a |
---|---|
69 # If-Match, If-None-Match tests | 69 # If-Match, If-None-Match tests |
70 | 70 |
71 my ($t1, $etag); | 71 my ($t1, $etag); |
72 | 72 |
73 $t1 = http_get('/t'); | 73 $t1 = http_get('/t'); |
74 $t1 =~ /ETag: (".*")/; | |
75 $etag = $1; | |
74 | 76 |
75 SKIP: { | 77 like(http_get_inm('/t', $etag), qr/304/, 'if-none-match'); |
76 skip "no etag support", 8 if $t1 !~ /ETag: (".*")/; | 78 like(http_get_inm('/t', '"foo"'), qr/200/, 'if-none-match fail'); |
77 $etag = $1; | 79 like(http_get_inm('/t', '"foo", "bar", ' . $etag . ' , "baz"'), qr/304/, |
80 'if-none-match with complex list'); | |
81 like(http_get_inm('/t', '*'), qr/304/, 'if-none-match all'); | |
78 | 82 |
79 like(http_get_inm('/t', $etag), qr/304/, 'if-none-match'); | 83 like(http_get_im('/t', $etag), qr/200/, 'if-match'); |
80 like(http_get_inm('/t', '"foo"'), qr/200/, 'if-none-match fail'); | 84 like(http_get_im('/t', '"foo"'), qr/412/, 'if-match fail'); |
81 like(http_get_inm('/t', '"foo", "bar", ' . $etag . ' , "baz"'), qr/304/, | 85 like(http_get_im('/t', '"foo", "bar", ' . "\t" . $etag . ' , "baz"'), |
82 'if-none-match with complex list'); | |
83 like(http_get_inm('/t', '*'), qr/304/, 'if-none-match all'); | |
84 | |
85 like(http_get_im('/t', $etag), qr/200/, 'if-match'); | |
86 like(http_get_im('/t', '"foo"'), qr/412/, 'if-match fail'); | |
87 like(http_get_im('/t', '"foo", "bar", ' . "\t" . $etag . ' , "baz"'), | |
88 qr/200/, 'if-match with complex list'); | 86 qr/200/, 'if-match with complex list'); |
89 like(http_get_im('/t', '*'), qr/200/, 'if-match all'); | 87 like(http_get_im('/t', '*'), qr/200/, 'if-match all'); |
90 } | |
91 | 88 |
92 ############################################################################### | 89 ############################################################################### |
93 | 90 |
94 sub http_get_ims { | 91 sub http_get_ims { |
95 my ($url, $ims) = @_; | 92 my ($url, $ims) = @_; |