PerlDancer/Dancer2 — pull request #715 by veryrusty (2014-10-05 13:27:18+00:00)
Title: Replace route handler & attribute triggers in the response with Plack middleware

The megasplat route added by Handler::File is replaced with Plack::Middleware::Static. The middleware is conditionally wrapped around the app, providing consistent dispatch with static content being handled first (like Dancer1, and typical production deployment scenarios where apache or nginx would be used for serving static content). This resolves #664, and #684. There is also a (currently undocumented) setting to disable Middleware::Static from wrapping the app. The naming of this setting may want some tweaking..

Then the two attribute triggers in the Response object are replaced with Plack::Middleware::ContentLength and Plack::Middleware::RemoveRedundantBody. Plack::Middleware::FixMissingBodyInRedirect is also applied to add a note to the response body on redirects. This was a little bit of prep work for allowing more flexibility in responses, such as returning a filehandle.. need more tuits!