let people know if they are doing wrong
[catagits/Catalyst-Runtime.git] / lib / Catalyst.pm
index 4aa3601..68c9875 100644 (file)
@@ -120,7 +120,7 @@ __PACKAGE__->stats_class('Catalyst::Stats');
 
 # Remember to update this in Catalyst::Runtime as well!
 
-our $VERSION = '5.90052';
+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;