Code

gitweb: Don't use Content-Encoding: header in git_snapshot
authorJakub Narebski <jnareb@gmail.com>
Mon, 11 Dec 2006 17:09:58 +0000 (18:09 +0100)
committerJunio C Hamano <junkio@cox.net>
Tue, 12 Dec 2006 08:55:20 +0000 (00:55 -0800)
Do not use Content-Encoding: HTTP header in git_snapshot, using
instead type according to the snapshot type (compression type).
Some of web browser take Content-Encoding: to be _transparent_
also for downloading, and store decompressed file (with incorrect
compression suffix) on download.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
gitweb/gitweb.perl

index 5ea3fda540f00e4b7ee2c11c380eac86168eca17..145d5b53b8864b30ec4adbb6a699ce2f73b6ab21 100755 (executable)
@@ -3414,8 +3414,7 @@ sub git_snapshot {
        my $filename = basename($project) . "-$hash.tar.$suffix";
 
        print $cgi->header(
-               -type => 'application/x-tar',
-               -content_encoding => $ctype,
+               -type => "application/$ctype",
                -content_disposition => 'inline; filename="' . "$filename" . '"',
                -status => '200 OK');