use Plack::Middleware::HTTPExceptions;
use Plack::Middleware::FixMissingBodyInRedirect;
use Plack::Middleware::MethodOverride;
+use Plack::Middleware::RemoveRedundantBody;
use Plack::Util;
use Class::Load 'load_class';
# Remove incorrectly added body and content related meta data when returning
# an information response, or a response the is required to not include a body
- if ( $response->status =~ /^(1\d\d|[23]04)$/ ) {
- if($response->has_body) {
- $c->log->debug('Removing body for informational or no content http responses');
- $response->body('');
- $response->headers->remove_header("Content-Length");
- }
- }
-
$c->finalize_cookies;
$c->response->finalize_headers();
if(my $middleware = $class->_psgi_middleware) {
return (
Plack::Middleware::HTTPExceptions->new,
+ Plack::Middleware::RemoveRedundantBody->new,
Plack::Middleware::FixMissingBodyInRedirect->new,
Plack::Middleware::ContentLength->new,
Plack::Middleware::MethodOverride->new,