Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CGI CPAN distribution.

Report information
The Basics
Id: 27282
Status: resolved
Worked: 10 min
Priority: 0/
Queue: CGI

People
Owner: LDS [...] cpan.org
Requestors: byi-a2am [...] myamail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: CGI::Carp::fatalsToBrowser should return status 500 in case of error
Download (untitled) / with headers
text/plain 627b
When using CGI::Carp qw(fatalsToBrowser), fatal errors are reported with a 200 OK status instead of a 500 Internal Server Error. Using : - ActiveState perl 5.8.8 through an easyPHP 2.0 (apache 2.2.3) server on Windows XP SP2, CGI 3.20 and CGI::Carp 1.29 (also tested with the latest distribution CGI::3.29 and CGI::Carp 1.29), - Perl 5.8.5 on a CentOS 4 x86_64 with apache 2.0.52, CGI 3.05 and CGI::Carp 1.28. - In both cases, perl script was executed as normal CGI scripts (no mod_perl). I added print STDOUT "Status: 500\n"; after the last else of fatalsToBrowser subroutine on line 577 and got it working as expected.
From: byi-a2am [...] myamail.com
Proposed patch attached.
Download Carp.pm.patch
text/x-diff 318b
--- CGI.pm-3.29/CGI/Carp.pm 2006-11-08 17:50:59.000000000 +0100 +++ Carp.pm 2007-05-25 10:51:12.125000000 +0200 @@ -575,6 +575,7 @@ print STDOUT $mess; } else { + print STDOUT "Status: 500\n"; print STDOUT "Content-type: text/html\n\n"; print STDOUT $mess; }
Patch accepted. Thanks!


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.