Skip to contentSkip to conversation

gitweb: Don't use Content-Encoding: header in git_snapshot

PATCH New Jakub Narebski 1 participant 1 message Aug 11, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gitweb: Don't use Content-Encoding: header in git_snapshot

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.

---
 gitweb/gitweb.perl |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
gitweb/gitweb.perl +1 -2
index 7d24c10..040ee71 100755
@@ -3489,8 +3489,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');
 
Signature · 1 line
1.4.4.1