]> git.deb.at Git - deb/packages.git/commitdiff
Packages::DoIndex: Copy the improvements in HTTP headers from ::Dispatcher
authorFrank Lichtenheld <frank@lichtenheld.de>
Tue, 5 Aug 2008 22:52:53 +0000 (19:52 -0300)
committerFrank Lichtenheld <frank@lichtenheld.de>
Tue, 5 Aug 2008 22:53:53 +0000 (19:53 -0300)
lib/Packages/DoIndex.pm

index e1c5b6d3667ef650ace6d0ead1b2231684128259..21cd164077bedb78b7c4fc12d662e16f8faf9fe2 100644 (file)
@@ -4,6 +4,7 @@ use strict;
 use warnings;
 
 use CGI qw( :cgi );
+use POSIX qw( strftime );
 use Exporter;
 
 use Deb::Versions;
@@ -60,7 +61,8 @@ sub send_file {
            $headers{'-content-encoding'} = $encoding{$opts->{format}} if exists $encoding{$opts->{format}};
            my ($size,$mtime) = (stat("$wwwdir/$path"))[7,9];
            $headers{'-content-length'} = $size;
-           $headers{'-last-modified'} = gmtime($mtime);
+           $headers{'-vary'} = 'negotiate,accept-language';
+           $headers{'-last-modified'} = strftime("%a, %d %b %Y %T %z", localtime($mtime));
            print header( %headers );
 
            binmode INDEX;