diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 32c1907021..2a0c46c234 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -4290,7 +4290,7 @@ sub git_blob { open my $fd, "-|", git_cmd(), "cat-file", "blob", $hash or die_error(undef, "Couldn't cat $file_name, $hash"); my $mimetype = blob_mimetype($fd, $file_name); - if ($mimetype !~ m!^(?:text/|image/(?:gif|png|jpeg)$)!) { + if ($mimetype !~ m!^(?:text/|image/(?:gif|png|jpeg)$)! && -B $fd) { close $fd; return git_blob_plain($mimetype); } @@ -4331,16 +4331,7 @@ sub git_blob { } git_print_page_path($file_name, "blob", $hash_base); print "