From: Gerfried Fuchs Date: Mon, 31 Oct 2011 14:10:28 +0000 (+0100) Subject: fix If-Modified-Since handling, thanks to weasel X-Git-Url: https://git.deb.at/w?a=commitdiff_plain;h=0769c5831eeb062f38e3cef5666f54c2566b4e43;p=deb%2Fpackages.git fix If-Modified-Since handling, thanks to weasel --- diff --git a/lib/Packages/Dispatcher.pm b/lib/Packages/Dispatcher.pm index 08c6f96..105117f 100755 --- a/lib/Packages/Dispatcher.pm +++ b/lib/Packages/Dispatcher.pm @@ -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; }