]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/ViewVCS.pm
viewvcs: allow '0' as a valid filename for blob downloads
[public-inbox.git] / lib / PublicInbox / ViewVCS.pm
index 1e8c31f2634adad8ebdaf6c6ae42dc1116054763..d67b5eb41dc20e455a74d4a6b7472d37b285e2bf 100644 (file)
@@ -96,7 +96,6 @@ sub solve_result {
        my $raw_link = "(<a\nhref=$path>raw</a>)";
        if ($size > $max_size) {
                return stream_large_blob($ctx, $res, \$log, $fn) if defined $fn;
-               # TODO: stream the raw file if it's gigantic, at least
                $log = "<pre><b>Too big to show, download available</b>\n" .
                        "$oid $type $size bytes $raw_link</pre>" . $log;
                return html_page($ctx, 500, \$log);
@@ -111,7 +110,7 @@ sub solve_result {
        }
 
        my $binary = index($$blob, "\0") >= 0;
-       if ($fn) {
+       if (defined $fn) {
                my $h = [ 'Content-Length', $size, 'Content-Type' ];
                push(@$h, ($binary ? 'application/octet-stream' : 'text/plain'));
                return delete($ctx->{-wcb})->([200, $h, [ $$blob ]]);