From: Tomas Doran Date: Tue, 29 Mar 2011 15:55:35 +0000 (+0100) Subject: public apply_default_middlewares method X-Git-Tag: 5.89003~44^2~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f05b654b3811fd4d36cbd8be8c3bb24bad945812;hp=48429f3d90ed27e6f771daa7a9aa0474849b5915;p=catagits%2FCatalyst-Runtime.git public apply_default_middlewares method --- diff --git a/TODO b/TODO index e866d70..3e499fe 100644 --- a/TODO +++ b/TODO @@ -31,13 +31,14 @@ http://github.com/willert/catalyst-plugin-log4perl-simple/tree ### Blockers * Test all the options work on all of the scripts - * Fix nginx / lighttpd middlewares so that they are generic, or can somehow + * Fix nginx middlewares so that they are generic, or can somehow be used by people with their own .psgi files * Fix a sane / nicer way to do custom engines. ### Nice to have - * <@rafl> i've been thinking of maybe providing MyApp->apply_default_middlewares($psgi_app) + * <@rafl> i've been thinking of maybe providing + MyApp->apply_default_middlewares($psgi_app) * Capture arguments that the plack engine component was run with somewhere, to more easily support custom args from scripts (e.g. Gitalist's --git_dir) diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index c337b30..e01270d 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -2665,14 +2665,12 @@ documentation on how to upgrade from Catalyst::Engine::PSGI. EOW } - return $app->_wrapped_legacy_psgi_app($app->psgi_app); + return $app->apply_default_middlewares($app->psgi_app); } -# Note - this is for back compatibility. Catalyst should not know or care about -# how it's deployed. The recommended way of configuring this is now to -# use the ReverseProxy middleware yourself if you want it in a .psgi -# file. -sub _wrapped_legacy_psgi_app { +# FIXME - document me + +sub apply_default_middlewares { my ($app, $psgi_app) = @_; $psgi_app = Plack::Middleware::Conditional->wrap(