]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: Use underscore instead of hyphen to separate words in HTTP headers names
authorJakub Narebski <redacted>
Tue, 22 Aug 2006 14:55:34 +0000 (16:55 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:10 +0000 (00:07 -0400)
Use underscore (which will be turned into hyphen) to separate words in
HTTP header names, in keys to CGI header() method, consistently.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index 1f91b521ef11fed7e96501fb2dec8b0f7f815e07c671b4517555f1f77ef1a060..865b04a2c2424793d775b728476f671f57b4d6a0fb3d6fc93dfcc0f50fd533b5 100755 (executable)
@@ -2198,7 +2198,8 @@ sub git_blob_plain {
                $save_as .= '.txt';
        }
 
-       print $cgi->header(-type => "$type", '-content-disposition' => "inline; filename=\"$save_as\"");
+       print $cgi->header(-type => "$type",
+                          -content_disposition => "inline; filename=\"$save_as\"");
        undef $/;
        binmode STDOUT, ':raw';
        print <$fd>;
@@ -2382,8 +2383,8 @@ sub git_snapshot {
        my $filename = basename($project) . "-$hash.tar.$suffix";
 
        print $cgi->header(-type => 'application/x-tar',
-                          -content-encoding => $ctype,
-                         '-content-disposition' => "inline; filename=\"$filename\"",
+                          -content_encoding => $ctype,
+                          -content_disposition => "inline; filename=\"$filename\"",
                           -status => '200 OK');
 
        open my $fd, "-|", "$GIT tar-tree $hash \'$project\' | $command" or
@@ -2701,7 +2702,7 @@ sub git_commitdiff_plain {
 
        print $cgi->header(-type => "text/plain",
                           -charset => 'utf-8',
-                         '-content-disposition' => "inline; filename=\"git-$hash.patch\"");
+                          -content_disposition => "inline; filename=\"git-$hash.patch\"");
        my %ad = parse_date($co{'author_epoch'}, $co{'author_tz'});
        my $comment = $co{'comment'};
        print "From: $co{'author'}\n" .
This page took 0.345028 seconds and 4 git commands to generate.