From 0769c5831eeb062f38e3cef5666f54c2566b4e43 Mon Sep 17 00:00:00 2001 From: Gerfried Fuchs Date: Mon, 31 Oct 2011 15:10:28 +0100 Subject: [PATCH] fix If-Modified-Since handling, thanks to weasel --- lib/Packages/Dispatcher.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; } -- 2.39.2