From 960540827f3a20cae43b661cc1fe82a87de5f1ca Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Tue, 5 Aug 2008 19:52:53 -0300 Subject: [PATCH] Packages::DoIndex: Copy the improvements in HTTP headers from ::Dispatcher --- lib/Packages/DoIndex.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.39.2