From: John Napiorkowski Date: Sat, 7 May 2011 03:04:09 +0000 (-0400) Subject: got all the tests running again X-Git-Tag: 5.89003~43 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=1316cc6465a09bcc5755b8b60f321ec7f2585eb8 got all the tests running again --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 03ce6ab..77844da 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -2688,7 +2688,23 @@ EOW return $app->apply_default_middlewares($app->psgi_app); } -# FIXME - document me +=head2 $c->apply_default_middlewares + +Adds the following L middlewares to your application, since they are +useful and commonly needed: + +L, (conditionally added based on the status +of your $ENV{REMOTE_ADDR}, and can be forced on with C +or forced off with C), L +(if you are using Lighttpd), L (always +applied since this middleware is smart enough to conditionally apply itself). + +Additionally if we detect we are using Nginx, we add a bit of custom middleware +to solve some problems with the way that server handles $ENV{PATH_INFO} and +$ENV{SCRIPT_NAME} + +=cut + sub apply_default_middlewares { my ($app, $psgi_app) = @_; diff --git a/t/aggregate/unit_core_engine_fixenv-iis6.t b/t/aggregate/unit_core_engine_fixenv-iis6.t index 952711f..cefcd35 100644 --- a/t/aggregate/unit_core_engine_fixenv-iis6.t +++ b/t/aggregate/unit_core_engine_fixenv-iis6.t @@ -54,7 +54,7 @@ sub fix_env { my (%input_env) = @_; my $mangled_env; - my $app = Catalyst->_wrapped_legacy_psgi_app(sub { + my $app = Catalyst->apply_default_middlewares(sub { my ($env) = @_; $mangled_env = $env; return [ 200, ['Content-Type' => 'text/plain'], [''] ]; diff --git a/t/aggregate/unit_core_engine_fixenv-lighttpd.t b/t/aggregate/unit_core_engine_fixenv-lighttpd.t index 9043290..9c71ddb 100644 --- a/t/aggregate/unit_core_engine_fixenv-lighttpd.t +++ b/t/aggregate/unit_core_engine_fixenv-lighttpd.t @@ -38,7 +38,7 @@ sub fix_env { my (%input_env) = @_; my $mangled_env; - my $app = Catalyst->_wrapped_legacy_psgi_app(sub { + my $app = Catalyst->apply_default_middlewares(sub { my ($env) = @_; $mangled_env = $env; return [ 200, ['Content-Type' => 'text/plain'], [''] ]; diff --git a/t/author/http-server.t b/t/author/http-server.t index 3bc33a0..0edba01 100644 --- a/t/author/http-server.t +++ b/t/author/http-server.t @@ -43,7 +43,7 @@ if ($pid) { unshift @INC, "$tmpdir/TestApp/lib", "$FindBin::Bin/../../lib"; require TestApp; - my $psgi_app = TestApp->_wrapped_legacy_psgi_app(TestApp->psgi_app); + my $psgi_app = TestApp->apply_default_middlewares(TestApp->psgi_app); Plack::Loader->auto(port => $port)->run(builder { mount '/test_prefix' => $psgi_app; mount '/' => sub {