From: Frank Lichtenheld Date: Tue, 5 Aug 2008 22:52:53 +0000 (-0300) Subject: Packages::DoIndex: Copy the improvements in HTTP headers from ::Dispatcher X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=960540827f3a20cae43b661cc1fe82a87de5f1ca;p=deb%2Fpackages.git Packages::DoIndex: Copy the improvements in HTTP headers from ::Dispatcher --- diff --git a/lib/Packages/DoIndex.pm b/lib/Packages/DoIndex.pm index e1c5b6d..21cd164 100644 --- a/lib/Packages/DoIndex.pm +++ b/lib/Packages/DoIndex.pm @@ -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;