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
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Type: text/plain; charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 627
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.
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Message-Id: <rt-3.6.HEAD-14773-1180083303-614.27282-0-0 [...] rt.cpan.org>
Content-Type: multipart/mixed; boundary="----------=_1180083303-14773-1"
From: byi-a2am [...] myamail.com
X-RT-Original-Encoding: utf-8
Content-Length: 0
Content-Disposition: inline
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 24
Proposed patch attached.
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Type: multipart/mixed; boundary="----------=_1180083303-14773-0"
Content-Length: 0
Content-Type: text/plain; charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 0
Content-Type: application/octet-stream; name="Carp.pm.patch"
Content-Disposition: inline; filename="Carp.pm.patch"
Content-Transfer-Encoding: base64
Content-Length: 318
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; }
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.6.HEAD-14749-1180124255-865.27282-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 23
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.