We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e994fd6 commit 0c45d62Copy full SHA for 0c45d62
lib/CGI/Carp.pm
@@ -440,13 +440,13 @@ and the time and date of the error.
440
END
441
;
442
my $mod_perl = exists $ENV{MOD_PERL};
443
- print STDOUT "Content-type: text/html\n\n"
444
- unless $mod_perl;
445
446
warningsToBrowser(1); # emit warnings before dying
447
448
if ($CUSTOM_MSG) {
449
if (ref($CUSTOM_MSG) eq 'CODE') {
+ print STDOUT "Content-type: text/html\n\n"
+ unless $mod_perl;
450
&$CUSTOM_MSG($msg); # nicer to perl 5.003 users
451
return;
452
} else {
@@ -490,7 +490,13 @@ END
490
$r->custom_response(500,$mess);
491
}
492
493
- print STDOUT $mess;
+ if (eval{tell STDOUT}) {
494
+ print STDOUT $mess;
495
+ }
496
+ else {
497
+ print STDOUT "Content-type: text/html\n\n";
498
499
500
501
502
0 commit comments