Make _wrapped_legacy_psgi_app do wrapping only
Florian Ragwitz [Wed, 2 Mar 2011 10:57:39 +0000 (11:57 +0100)]
We now pass in the psgi app to wrap, which should make it quite a bit easier to
test. We'll need that to check if the various quirk fixes for different web
servers actually work.

lib/Catalyst.pm

index 696fd57..e5e43ea 100644 (file)
@@ -2642,7 +2642,7 @@ sub _setup_psgi_app {
             if -e $psgi_file;
     }
 
-    return $app->_wrapped_legacy_psgi_app;
+    return $app->_wrapped_legacy_psgi_app($app->psgi_app);
 }
 
 # Note - this is for back compatibility. Catalyst should not know or care about
@@ -2650,10 +2650,10 @@ sub _setup_psgi_app {
 #        use the ReverseProxy middleware yourself if you want it in a .psgi
 #        file.
 sub _wrapped_legacy_psgi_app {
-    my ($app) = @_;
+    my ($app, $psgi_app) = @_;
 
     return Plack::Middleware::Conditional->wrap(
-        $app->psgi_app,
+        $psgi_app,
         builder   => sub { Plack::Middleware::ReverseProxy->wrap($_[0]) },
         condition => sub {
             my ($env) = @_;