From: Christian Hansen Date: Sat, 2 Apr 2005 07:38:08 +0000 (+0000) Subject: don't override status or content_length X-Git-Tag: 5.7099_04~1622 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=c4695f3aa02151dcd257c01cdee3f70cfa2e5888 don't override status or content_length --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index e7cf1d5..e61d793 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -171,8 +171,8 @@ sub import { else { my $plugin = "Catalyst::Plugin::$_"; - # Plugin caller should be our application class - eval "package $caller; require $plugin"; + $plugin->require; + if ($@) { $caller->log->error(qq/Couldn't load plugin "$plugin", "$@"/); } diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index bc236b1..750f3fe 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -164,7 +164,7 @@ sub finalize { 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); + $c->response->status(302) if $c->response->status !~ /3\d\d$/; } if ( $#{ $c->error } >= 0 ) { @@ -175,7 +175,7 @@ sub finalize { $c->finalize_error; } - if ( $c->response->output ) { + if ( $c->response->output && !$c->response->content_length ) { use bytes; # play safe with a utf8 aware perl $c->response->content_length( length $c->response->output ); }