]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: True fix: Support for the standard mime.types map in gitweb
authorJakub Narebski <redacted>
Mon, 14 Aug 2006 00:16:33 +0000 (02:16 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:05:47 +0000 (00:05 -0400)
True fix for error in mimetype_guess, error introduced in original commit
2d00737489b8c61ed616b261c7c9bd314e2b0b41 and later fixed temporarily
by commenting out the line that caused error in commit
57bd4d3523efecf60197040cad34154aff4ddf80.

Gitweb now supports mime.types map $mimetypes_file relative to project.

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

index 02b7c921a801c520204ba80699aacff89e2ecaac5cd2329fa17fea3b10c6b338..71835d40f19add9cc8205ceb3c7469cd24003bda356d0f383bd92e45a981aaa1 100755 (executable)
@@ -880,7 +880,10 @@ sub mimetype_guess {
 
        if ($mimetypes_file) {
                my $file = $mimetypes_file;
-               #$file =~ m#^/# or $file = "$projectroot/$path/$file";
+               if ($file !~ m!^/!) { # if it is relative path
+                       # it is relative to project
+                       $file = "$projectroot/$project/$file";
+               }
                $mime = mimetype_guess_file($filename, $file);
        }
        $mime ||= mimetype_guess_file($filename, '/etc/mime.types');
This page took 0.377007 seconds and 4 git commands to generate.