]> git.deb.at Git - deb/packages.git/commitdiff
Packages::DoIndex: Send Content-Length and Last-Modified
authorFrank Lichtenheld <frank@lichtenheld.de>
Sat, 8 Sep 2007 22:28:55 +0000 (00:28 +0200)
committerFrank Lichtenheld <frank@lichtenheld.de>
Sun, 9 Sep 2007 01:02:37 +0000 (03:02 +0200)
lib/Packages/DoIndex.pm

index 8f96fdf8b20ef6f79a4353480bfca06c3ebc3f9d..0c5d89dfa57ef48a618b0e423facb5e115843236 100644 (file)
@@ -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;