Fix config parsing for WrapCGI
Rafael Kitover [Wed, 2 Jul 2008 01:53:50 +0000 (01:53 +0000)]
lib/Catalyst/Controller/CGIBin.pm
lib/Catalyst/Controller/WrapCGI.pm

index a73be05..b2eaab0 100644 (file)
@@ -96,7 +96,7 @@ sub register_actions {
             undef $@;
         }
 
-        $app->log->info("Registering root/cgi_bin/$file as a $type CGI.")
+        $app->log->info("Registering root/cgi-bin/$file as a $type CGI.")
             if $app->debug;
 
         my $action_name = $self->cgi_action($file);
index 39657e7..a4cd5de 100644 (file)
@@ -146,7 +146,11 @@ sub wrap_cgi {
 
   my @env;
 
-  for (@{ $self->{CGI}{pass_env} }) {
+  my $pass_env = $self->{CGI}{pass_env};
+  $pass_env = []            if not defined $pass_env;
+  $pass_env = [ $pass_env ] unless ref $pass_env;
+
+  for (@$pass_env) {
     if (m!^/(.*)/\z!) {
       my $re = qr/$1/;
       push @env, grep /$re/, keys %ENV;