From: Florian Ragwitz Date: Wed, 2 Mar 2011 10:57:39 +0000 (+0100) Subject: Make _wrapped_legacy_psgi_app do wrapping only X-Git-Tag: 5.89003~103 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=c72bc6ebc2aaad8773c582551b351aa6bb46be17 Make _wrapped_legacy_psgi_app do wrapping only 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. --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 696fd57..e5e43ea 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -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) = @_;