X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FEngine.pm;h=593daebe230817d3b8a0fa4c545f05e4a259f964;hb=39de91b0c198551ced998d476eadb266d62ceca0;hp=4b7fad7a4bf3d4a15bf908e9f2c03e19c761bfb5;hpb=6dc87a0f8301391acfe25ee5bcaad0fe48dad559;p=catagits%2FCatalyst-Runtime.git
diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm
index 4b7fad7..593daeb 100644
--- a/lib/Catalyst/Engine.pm
+++ b/lib/Catalyst/Engine.pm
@@ -127,11 +127,13 @@ sub execute {
my ( $c, $class, $code ) = @_;
$class = $c->comp($class) || $class;
$c->state(0);
+ my $callsub = ( caller(1) )[3];
eval {
if ( $c->debug )
{
my $action = $c->actions->{reverse}->{"$code"};
$action = "/$action" unless $action =~ /\-\>/;
+ $action = " $action" if $callsub =~ /forward$/;
my ( $elapsed, @state ) =
$c->benchmark( $code, $class, $c, @{ $c->req->args } );
push @{ $c->{stats} },
@@ -161,111 +163,25 @@ sub finalize {
$c->finalize_cookies;
- if ( my $location = $c->res->redirect ) {
+ if ( my $location = $c->response->redirect ) {
$c->log->debug(qq/Redirecting to "$location"/) if $c->debug;
$c->response->header( Location => $location );
- $c->response->status(302);
- }
-
- if ( $c->res->status =~ /^(1\d\d|[23]04)$/ ) {
- $c->response->headers->remove_content_headers;
- return $c->finalize_headers;
- }
-
- if ( !$c->res->output || $#{ $c->error } >= 0 ) {
- $c->res->headers->content_type('text/html');
- my $name = $c->config->{name} || 'Catalyst Application';
- my ( $title, $error, $infos );
- if ( $c->debug ) {
- $error = join '
', @{ $c->error };
- $error ||= 'No output';
- $title = $name = "$name on Catalyst $Catalyst::VERSION";
- my $req = encode_entities Dumper $c->req;
- my $res = encode_entities Dumper $c->res;
- my $stash = encode_entities Dumper $c->stash;
- $infos = <<"";
-
-Request
-
$req-Response
$res-Stash
$stash+ $c->response->status(302) if $c->response->status !~ /3\d\d$/; + } - } - else { - $title = $name; - $error = ''; - $infos = <<""; -
-(en) Please come back later -(de) Bitte versuchen sie es spaeter nocheinmal -(nl) Gelieve te komen later terug -(no) Vennligst prov igjen senere -(fr) Veuillez revenir plus tard -(es) Vuelto por favor mas adelante -(pt) Voltado por favor mais tarde -(it) Ritornato prego più successivamente -+ if ( $#{ $c->error } >= 0 ) { + $c->finalize_error; + } - $name = ''; - } - $c->res->{output} = <<""; - - -
$req+Response
$res+Stash
$stash+ + } + else { + $title = $name; + $error = ''; + $infos = <<""; +
+(en) Please come back later +(de) Bitte versuchen sie es spaeter nocheinmal +(nl) Gelieve te komen later terug +(no) Vennligst prov igjen senere +(fr) Veuillez revenir plus tard +(es) Vuelto por favor mas adelante +(pt) Voltado por favor mais tarde +(it) Ritornato prego più successivamente ++ + $name = ''; + } + $c->res->output( <<"" ); + + +