diff options
author | Gerfried Fuchs <rhonda@debian.org> | 2011-10-31 15:10:28 +0100 |
---|---|---|
committer | Gerfried Fuchs <rhonda@debian.org> | 2011-10-31 15:10:28 +0100 |
commit | 0769c5831eeb062f38e3cef5666f54c2566b4e43 (patch) | |
tree | a51f1b2b564a4194405e57984de48dee7a6cb97e | |
parent | a155c4187816a5ed393d08ef582dfc32d9d68d62 (diff) |
fix If-Modified-Since handling, thanks to weasel
-rwxr-xr-x | lib/Packages/Dispatcher.pm | 5 |
1 files 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; } |