my $qsp = PublicInbox::Qspawn->new($cmd);
my @cl = ('Content-Length', $size);
my $env = $ctx->{env};
+ $env->{'public-inbox.tmpgit'} = $git; # for {-tmp}/File::Temp::Dir
$env->{'qspawn.wcb'} = delete $ctx->{-wcb};
$qsp->psgi_return($env, undef, sub {
my ($r, $bref) = @_;
return html_page($ctx, 500, \$log);
}
- my $binary = index($$blob, "\0") >= 0;
+ my $bin = index(substr($$blob, 0, $BIN_DETECT), "\0") >= 0;
if (defined $fn) {
my $h = [ 'Content-Length', $size, 'Content-Type' ];
- push(@$h, ($binary ? 'application/octet-stream' : 'text/plain'));
+ push(@$h, ($bin ? 'application/octet-stream' : 'text/plain'));
return delete($ctx->{-wcb})->([200, $h, [ $$blob ]]);
}
- if ($binary) {
+ if ($bin) {
$log = "<pre>$oid $type $size bytes (binary)" .
" $raw_link</pre>" . $log;
return html_page($ctx, 200, \$log);