From c3b6d74d1bcb22d6eb92e2b0bb8a897c0fb03d0f Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Sun, 9 Sep 2007 00:28:55 +0200 Subject: [PATCH] Packages::DoIndex: Send Content-Length and Last-Modified --- lib/Packages/DoIndex.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Packages/DoIndex.pm b/lib/Packages/DoIndex.pm index 8f96fdf..0c5d89d 100644 --- a/lib/Packages/DoIndex.pm +++ b/lib/Packages/DoIndex.pm @@ -55,6 +55,9 @@ sub send_file { $headers{'-charset'} = get_charset( $opts->{lang} ); $headers{'-type'} = get_mime( $opts->{format}, 'text/plain' ); $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); print header( %headers ); binmode INDEX; -- 2.39.2