summaryrefslogtreecommitdiff
path: root/tests/cachable.t
diff options
context:
space:
mode:
authorStefan Bühler <stbuehler@web.de>2013-01-22 13:08:21 +0000
committerStefan Bühler <stbuehler@web.de>2013-01-22 13:08:21 +0000
commit543bd249fb385c8ec0ec30b24eafb92b6933a223 (patch)
tree103cd4657f059e7a3a6a4987d1dafd5cc7134dd2 /tests/cachable.t
parent9cd8faa1b645f8294dd769fa29f40863ccf22e47 (diff)
downloadlighttpd1.4-543bd249fb385c8ec0ec30b24eafb92b6933a223.tar.gz
lighttpd1.4-543bd249fb385c8ec0ec30b24eafb92b6933a223.zip
fix handling of If-Modified-Since if If-None-Match is present (don't return 412 for date parsing errors); follow current draft for HTTP/1.1, which tells us to ignore If-Modified-Since if we have matching etags.
See: http://tools.ietf.org/html/draft-ietf-httpbis-p4-conditional-21#section-5 > it makes sense to ignore the If-Modified-Since when entity tags are > understood and available for the selected representation. git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2865 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'tests/cachable.t')
-rwxr-xr-xtests/cachable.t10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/cachable.t b/tests/cachable.t
index 605a68f1..381f44e0 100755
--- a/tests/cachable.t
+++ b/tests/cachable.t
@@ -78,8 +78,8 @@ If-None-Match: $etag
If-Modified-Since: Sun, 01 Jan 1970 00:00:01 GMT; foo
EOF
);
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-ok($tf->handle_http($t) == 0, 'Conditional GET - ETag + old Last-Modified');
+$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 304 } ];
+ok($tf->handle_http($t) == 0, 'Conditional GET - ETag + old Last-Modified (which should be ignored)');
$t->{REQUEST} = ( <<EOF
GET / HTTP/1.0
@@ -88,7 +88,7 @@ If-Modified-Since: $now; foo
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 304 } ];
-ok($tf->handle_http($t) == 0, 'Conditional GET - ETag, Last-Modified + comment');
+ok($tf->handle_http($t) == 0, 'Conditional GET - ETag, Last-Modified + comment (which should be ignored)');
$t->{REQUEST} = ( <<EOF
GET / HTTP/1.0
@@ -105,8 +105,8 @@ If-None-Match: $etag
If-Modified-Since: $now foo
EOF
);
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 412 } ];
-ok($tf->handle_http($t) == 0, 'Conditional GET - ETag + Last-Modified + overlong timestamp');
+$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 304 } ];
+ok($tf->handle_http($t) == 0, 'Conditional GET - ETag + Last-Modified + overlong timestamp (which should be ignored)');
$t->{REQUEST} = ( <<EOF
GET / HTTP/1.0