X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=68c98758c1b85e5e7152688a9f4407e95033a422;hb=9629478d55a9a9a891ff3e12557aa334a9783c58;hp=673b3c0b01b8963c6c9d5ce449f11c090fe2e7dc;hpb=17176f15aa0e2e0323b9d4cc6f32a9b94cfa785e;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 673b3c0..68c9875 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -120,7 +120,7 @@ __PACKAGE__->stats_class('Catalyst::Stats'); # Remember to update this in Catalyst::Runtime as well! -our $VERSION = '5.90051'; +our $VERSION = '5.90059_001'; sub import { my ( $class, @arguments ) = @_; @@ -1958,10 +1958,15 @@ EOF } } - # Errors + # 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)$/ ) { - $response->headers->remove_header("Content-Length"); - $response->body(''); + 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;