X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FController%2FWrapCGI.pm;h=d82896dd3f4098297c22451e3eefe33183363d72;hb=refs%2Fheads%2Fmaster;hp=f1de732e5aa301e7f86e31a47bd2b591829d450d;hpb=05f3f060f92985dd99c3e4a4577aa3284efca2fe;p=catagits%2FCatalyst-Controller-WrapCGI.git diff --git a/lib/Catalyst/Controller/WrapCGI.pm b/lib/Catalyst/Controller/WrapCGI.pm index f1de732..d82896d 100644 --- a/lib/Catalyst/Controller/WrapCGI.pm +++ b/lib/Catalyst/Controller/WrapCGI.pm @@ -6,10 +6,10 @@ use mro 'c3'; extends 'Catalyst::Controller'; +use Catalyst::Exception (); use HTTP::Request::AsCGI (); use HTTP::Request (); use URI (); -use Catalyst::Exception (); use URI::Escape; use HTTP::Request::Common; @@ -21,7 +21,7 @@ Catalyst::Controller::WrapCGI - Run CGIs in Catalyst =cut -our $VERSION = '0.029'; +our $VERSION = '0.035'; =head1 SYNOPSIS @@ -163,7 +163,7 @@ sub wrap_cgi { if ($body) { # Slurp from body filehandle local $/; $body_content = <$body>; } else { - my $body_params = $c->req->body_parameters; + my $body_params = $c->req->body_parameters || {}; if (my %uploads = %{ $c->req->uploads }) { my $post = POST 'http://localhost/', @@ -234,9 +234,12 @@ sub wrap_cgi { select($old); - Catalyst::Exception->throw( - message => "CGI invocation failed: $saved_error" - ) if $saved_error; + if( $saved_error ) { + die $saved_error if ref $saved_error; + Catalyst::Exception->throw( + message => "CGI invocation failed: $saved_error" + ); + } } return $env->response; @@ -385,9 +388,11 @@ Matt S. Trout C<< >> =head1 CONTRIBUTORS -Rafael Kitover C<< >> +Caelum: Rafael Kitover + +confound: Hans Dieter Pearcey -Hans Dieter Pearcey C<< >> +rbuels: Robert Buels Some code stolen from Tatsuhiko Miyagawa's L.