]> git.deb.at Git - deb/packages.git/commitdiff
fix If-Modified-Since handling, thanks to weasel
authorGerfried Fuchs <rhonda@debian.org>
Mon, 31 Oct 2011 14:10:28 +0000 (15:10 +0100)
committerGerfried Fuchs <rhonda@debian.org>
Mon, 31 Oct 2011 14:10:28 +0000 (15:10 +0100)
lib/Packages/Dispatcher.pm

index 08c6f96a1c7cee40a1985e2a88eeb3006908f27f..105117f6ca6f0a382043ed10ea4ff943808bdbdf 100755 (executable)
@@ -101,8 +101,9 @@ sub do_dispatch {
     $last_modified = $now if $now - $last_modified < 3600;
 
     if ($input->http('If-Modified-Since') and
-       (my $modtime = str2time($input->http('If-Modified-Since'), 'UTC'))) {
-       if ($modtime <= $last_modified) {
+       (my $client_timestamp = str2time($input->http('If-Modified-Since'), 'UTC'))) {
+       if ($client_timestamp > $last_modified) {
+           # we are not modified since asked -> return "304 Not Modified"
            print $input->header(-status => 304);
            exit;
        }