]> Lady’s Gitweb - Gitweb/commit
gitweb: Teach "a=blob" action to be more lenient about blob/file mime type
authorJakub Narebski <redacted>
Sat, 15 Dec 2007 14:41:49 +0000 (15:41 +0100)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:12 +0000 (00:07 -0400)
commitaa3f2d6cd87c65fdcb6833f217a3e034d686c3f5b261d16c01623a6149c93937
tree6bb13c07a3c132197bf40f332369af5f46dabd50287bbe9ec085fe2ccec55f39
parent694f04e3f03d64419c3a32c9e7ad3ddaa3533c2f4613dd3a1b8eb9b52be6ba6d
gitweb: Teach "a=blob" action to be more lenient about blob/file mime type

Since 930cf7dd7cc6b87d173f182230763e1f1913d319 'blob' action knows the
file type; if the file type is not "text/*" or one of common network
image formats/mimetypes (gif, png, jpeg) then the action "blob"
defaulted to "blob_plain".  This caused the problem if mimetypes file
was not well suited for web, for example returning "application/x-sh"
for "*.sh" shell scripts, instead of "text/plain" (or other "text/*").

Now "blob" action defaults to "blob_plain" ('raw' view) only if file
is of type which is neither "text/*" nor "image/{gif,png,jpeg}"
AND it is binary file.  Otherwise it assumes that it can be displayed
either in <img> tag ("image/*" mimetype), or can be displayed line by
line (otherwise).

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl
This page took 0.020912 seconds and 4 git commands to generate.