X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst.pm;h=499e49a1bbe48487b72043517604f26077cad52b;hp=39d513d6b9ba01f80ef74d5414ba7e2df8da0de1;hb=ecf903d0523a9a927684d6f9dc125f8d27bf2f6f;hpb=9ae060f08b6948a1d89eef14fff9d78e6a435d29 diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 39d513d..499e49a 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -44,6 +44,7 @@ use Plack::Middleware::LighttpdScriptNameFix; use Plack::Middleware::ContentLength; use Plack::Middleware::Head; use Plack::Middleware::HTTPExceptions; +use Plack::Middleware::FixMissingBodyInRedirect; use Plack::Util; use Class::Load 'load_class'; @@ -1935,23 +1936,6 @@ sub finalize_headers { if ( my $location = $response->redirect ) { $c->log->debug(qq/Redirecting to "$location"/) if $c->debug; $response->header( Location => $location ); - - if ( !$response->has_body ) { - # Add a default body if none is already present - my $encoded_location = encode_entities($location); - $response->body(<<"EOF"); - - - - Moved - - -

This item has moved here.

- - -EOF - $response->content_type('text/html; charset=utf-8'); - } } # Remove incorrectly added body and content related meta data when returning @@ -3128,6 +3112,7 @@ sub registered_middlewares { if(my $middleware = $class->_psgi_middleware) { return ( Plack::Middleware::HTTPExceptions->new, + Plack::Middleware::FixMissingBodyInRedirect->new, Plack::Middleware::ContentLength->new, Plack::Middleware::Head->new, @$middleware); @@ -3951,6 +3936,8 @@ rainboxx: Matthias Dietrich, C dd070: Dhaval Dhanani +Upasana + =head1 COPYRIGHT Copyright (c) 2005, the above named PROJECT FOUNDER and CONTRIBUTORS.