got all the tests running again
John Napiorkowski [Sat, 7 May 2011 03:04:09 +0000 (23:04 -0400)]
lib/Catalyst.pm
t/aggregate/unit_core_engine_fixenv-iis6.t
t/aggregate/unit_core_engine_fixenv-lighttpd.t
t/author/http-server.t

index 03ce6ab..77844da 100644 (file)
@@ -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<Plack> middlewares to your application, since they are
+useful and commonly needed:
+
+L<Plack::Middleware::ReverseProxy>, (conditionally added based on the status
+of your $ENV{REMOTE_ADDR}, and can be forced on with C<using_frontend_proxy>
+or forced off with C<ignore_frontend_proxy>), L<Plack::Middleware::LighttpdScriptNameFix>
+(if you are using Lighttpd), L<Plack::Middleware::IIS6ScriptNameFix> (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) = @_;
index 952711f..cefcd35 100644 (file)
@@ -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'], [''] ];
index 9043290..9c71ddb 100644 (file)
@@ -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'], [''] ];
index 3bc33a0..0edba01 100644 (file)
@@ -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 {