X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=972b390ab27689bfd4ce027b9cbe2bf3f3936ea7;hb=ad79be3450d4ece7161e721bc65debdb98e677f5;hp=696fd5795e0d1e8753de58374086c1541cc8c86f;hpb=1f440f555345b577d87e1b7e159aaa24121318ca;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 696fd57..972b390 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -34,6 +34,8 @@ use Catalyst::EngineLoader; use utf8; use Carp qw/croak carp shortmess/; use Try::Tiny; +use Plack::Middleware::Conditional; +use Plack::Middleware::ReverseProxy; BEGIN { require 5.008004; } @@ -2642,7 +2644,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 +2652,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) = @_;