aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerfried Fuchs <rhonda@debian.org>2011-10-31 15:10:28 +0100
committerGerfried Fuchs <rhonda@debian.org>2011-10-31 15:10:28 +0100
commit0769c5831eeb062f38e3cef5666f54c2566b4e43 (patch)
treea51f1b2b564a4194405e57984de48dee7a6cb97e
parenta155c4187816a5ed393d08ef582dfc32d9d68d62 (diff)
fix If-Modified-Since handling, thanks to weasel
-rwxr-xr-xlib/Packages/Dispatcher.pm5
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;
}