Commit dfa7c7d
gitweb: Teach "a=blob" action to be more lenient about blob/file mime type
Since 930cf7d '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 <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent bf901f8 commit dfa7c7d
1 file changed
+11
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4290 | 4290 | | |
4291 | 4291 | | |
4292 | 4292 | | |
4293 | | - | |
| 4293 | + | |
4294 | 4294 | | |
4295 | 4295 | | |
4296 | 4296 | | |
| |||
4331 | 4331 | | |
4332 | 4332 | | |
4333 | 4333 | | |
4334 | | - | |
4335 | | - | |
4336 | | - | |
4337 | | - | |
4338 | | - | |
4339 | | - | |
4340 | | - | |
4341 | | - | |
4342 | | - | |
4343 | | - | |
| 4334 | + | |
4344 | 4335 | | |
4345 | 4336 | | |
4346 | 4337 | | |
| |||
4349 | 4340 | | |
4350 | 4341 | | |
4351 | 4342 | | |
| 4343 | + | |
| 4344 | + | |
| 4345 | + | |
| 4346 | + | |
| 4347 | + | |
| 4348 | + | |
| 4349 | + | |
| 4350 | + | |
| 4351 | + | |
4352 | 4352 | | |
4353 | 4353 | | |
4354 | 4354 | | |
| |||
0 commit comments