# HG changeset patch # User Maxim Dounin # Date 1403460837 -14400 # Node ID 5c25acbc870ad9b9f0c028ea84e72b54a94e9d86 # Parent 020c4e47ecac39fc8c1b5506fe7e1d9e385053cf Tests: etags support is present in all supported branches. diff --git a/not_modified.t b/not_modified.t --- a/not_modified.t +++ b/not_modified.t @@ -71,23 +71,20 @@ SKIP: { my ($t1, $etag); $t1 = http_get('/t'); +$t1 =~ /ETag: (".*")/; +$etag = $1; -SKIP: { - skip "no etag support", 8 if $t1 !~ /ETag: (".*")/; - $etag = $1; - - like(http_get_inm('/t', $etag), qr/304/, 'if-none-match'); - like(http_get_inm('/t', '"foo"'), qr/200/, 'if-none-match fail'); - like(http_get_inm('/t', '"foo", "bar", ' . $etag . ' , "baz"'), qr/304/, +like(http_get_inm('/t', $etag), qr/304/, 'if-none-match'); +like(http_get_inm('/t', '"foo"'), qr/200/, 'if-none-match fail'); +like(http_get_inm('/t', '"foo", "bar", ' . $etag . ' , "baz"'), qr/304/, 'if-none-match with complex list'); - like(http_get_inm('/t', '*'), qr/304/, 'if-none-match all'); +like(http_get_inm('/t', '*'), qr/304/, 'if-none-match all'); - like(http_get_im('/t', $etag), qr/200/, 'if-match'); - like(http_get_im('/t', '"foo"'), qr/412/, 'if-match fail'); - like(http_get_im('/t', '"foo", "bar", ' . "\t" . $etag . ' , "baz"'), +like(http_get_im('/t', $etag), qr/200/, 'if-match'); +like(http_get_im('/t', '"foo"'), qr/412/, 'if-match fail'); +like(http_get_im('/t', '"foo", "bar", ' . "\t" . $etag . ' , "baz"'), qr/200/, 'if-match with complex list'); - like(http_get_im('/t', '*'), qr/200/, 'if-match all'); -} +like(http_get_im('/t', '*'), qr/200/, 'if-match all'); ############################################################################### diff --git a/spdy.t b/spdy.t --- a/spdy.t +++ b/spdy.t @@ -241,21 +241,14 @@ ok(grep ({ $_->{type} eq "SYN_REPLY" } @ ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; is($frame->{headers}->{':status'}, '200 OK', 'proxy cache unconditional'); -my $etag = $frame->{headers}->{'etag'}; - -SKIP: { -skip 'no etag', 1 unless defined $etag; - $sid2 = spdy_stream($sess, { path => '/proxy/t2.html', - headers => { "if-none-match" => $etag } + headers => { "if-none-match" => $frame->{headers}->{'etag'} } }); $frames = spdy_read($sess, all => [{ sid => $sid2, fin => 1 }]); ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames; is($frame->{headers}->{':status'}, 304, 'proxy cache conditional'); -} - # request body (uses proxied response) $sess = new_session();