[Catalyst-commits] r13935 - in Catalyst-Runtime/5.80/trunk: . lib/Catalyst/Engine

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Thu Jan 27 11:01:41 GMT 2011


Author: t0m
Date: 2011-01-27 11:01:41 +0000 (Thu, 27 Jan 2011)
New Revision: 13935

Modified:
   Catalyst-Runtime/5.80/trunk/Changes
   Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/FastCGI.pm
Log:
Fix undef warning in Engine::FastCGI

Modified: Catalyst-Runtime/5.80/trunk/Changes
===================================================================
--- Catalyst-Runtime/5.80/trunk/Changes	2011-01-26 17:19:19 UTC (rev 13934)
+++ Catalyst-Runtime/5.80/trunk/Changes	2011-01-27 11:01:41 UTC (rev 13935)
@@ -7,6 +7,9 @@
     which results in new Package::Stash, then it can leave you with a broken
     version of MooseX::Role::WithOverloading.
 
+  - Fix undef warning in Catalyst::Engine::FastCGI when writing an empty
+    body (e.g. doing a redirect)
+
 5.80030 2011-01-04 13:13:02
 
  New features:

Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/FastCGI.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/FastCGI.pm	2011-01-26 17:19:19 UTC (rev 13934)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/FastCGI.pm	2011-01-27 11:01:41 UTC (rev 13935)
@@ -159,6 +159,10 @@
 sub write {
     my ( $self, $c, $buffer ) = @_;
 
+    # ->write will be called once with the body, even in a redirect (and
+    # in that case, the body is undef)
+    $buffer = '' if !defined $buffer;
+
     unless ( $self->_prepared_write ) {
         $self->prepare_write($c);
         $self->_prepared_write(1);




More information about the Catalyst-commits mailing list