Fixed C::E::CGI to allow reuse of CGI.pm object
Christian Hansen [Thu, 21 Apr 2005 20:17:53 +0000 (20:17 +0000)]
lib/Catalyst/Engine.pm
lib/Catalyst/Engine/CGI.pm

index 00fecbc..eee80b8 100644 (file)
@@ -387,7 +387,7 @@ sub handler {
     return $status;
 }
 
-=item $c->prepare($r)
+=item $c->prepare($engine)
 
 Turns the engine-specific request( Apache, CGI ... )
 into a Catalyst context .
index 6d0fd12..e80c727 100644 (file)
@@ -184,8 +184,8 @@ sub prepare_path {
 =cut
 
 sub prepare_request { 
-    my $c = shift;
-    $c->cgi( CGI->new );
+    my ( $c, $cgi ) = @_;
+    $c->cgi( $cgi || CGI->new );
     $c->cgi->_reset_globals;
 }