X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=2d828b113094ec54aa86ef1d98db67ac5dc4537e;hb=f2ceb02dd49d80f5c4e38cd8cb80ff720149d5bf;hp=ec983a14b57e01cc8e3159c938889128a524fb45;hpb=cfb5d52a9772eecc218a5a1cec5ae8fe890f4e68;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index ec983a1..2d828b1 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -84,7 +84,7 @@ __PACKAGE__->stats_class('Catalyst::Stats'); # Remember to update this in Catalyst::Runtime as well! -our $VERSION = '5.89003'; +our $VERSION = '5.90002'; sub import { my ( $class, @arguments ) = @_; @@ -1866,6 +1866,7 @@ sub finalize_headers { $response->body( qq{
This item has moved here.
} ); + $response->content_type('text/html; charset=utf-8'); } } @@ -2603,25 +2604,28 @@ Sets up engine. =cut sub engine_class { - my $class = shift; - $class->engine_loader->catalyst_engine_class(@_); + my ($class, $requested_engine) = @_; + + if (!$class->engine_loader || $requested_engine) { + $class->engine_loader( + Catalyst::EngineLoader->new({ + application_name => $class, + (defined $requested_engine + ? (requested_engine => $requested_engine) : ()), + }), + ); + } + $class->engine_loader->catalyst_engine_class; } sub setup_engine { my ($class, $requested_engine) = @_; - $class->engine_loader( - Catalyst::EngineLoader->new({ - application_name => $class, - (defined $requested_engine - ? (requested_engine => $requested_engine) : ()), - }), - ); + my $engine = $class->engine_class($requested_engine); # Don't really setup_engine -- see _setup_psgi_app for explanation. return if $class->loading_psgi_file; - my $engine = $class->engine_class; Class::MOP::load_class($engine); if ($ENV{MOD_PERL}) { @@ -2723,34 +2727,10 @@ sub apply_default_middlewares { }, ); - my $server_matches = sub { - my ($re) = @_; - return sub { - my ($env) = @_; - my $server = $env->{SERVER_SOFTWARE}; - return unless $server; - return $server =~ $re ? 1 : 0; - }; - }; - # If we're running under Lighttpd, swap PATH_INFO and SCRIPT_NAME # http://lists.scsys.co.uk/pipermail/catalyst/2006-June/008361.html $psgi_app = Plack::Middleware::LighttpdScriptNameFix->wrap($psgi_app); - $psgi_app = Plack::Middleware::Conditional->wrap( - $psgi_app, - condition => $server_matches->(qr/^nginx/), - builder => sub { - my ($to_wrap) = @_; - return sub { - my ($env) = @_; - my $script_name = $env->{SCRIPT_NAME}; - $env->{PATH_INFO} =~ s/^$script_name//g; - return $to_wrap->($env); - }; - }, - ); - # we're applying this unconditionally as the middleware itself already makes # sure it doesn't fuck things up if it's not running under one of the right # IIS versions @@ -3058,8 +3038,46 @@ to be shown in hit debug tables in the test server. =item * C