Bad test failed to show bug.
Tomas Doran [Fri, 17 Dec 2010 00:49:54 +0000 (00:49 +0000)]
lib/Catalyst.pm
t/aggregate/live_engine_response_emptybody.t

index 8e0f17f..8a1c791 100644 (file)
@@ -1857,7 +1857,7 @@ sub finalize_headers {
     }
 
     # Content-Length
-    if ( defined $response->body && !$response->content_length ) {
+    if ( defined $response->body && length $response->body && !$response->content_length ) {
 
         # get the length from a filehandle
         if ( blessed( $response->body ) && $response->body->can('read') || ref( $response->body ) eq 'GLOB' )
index c4d6dec..825b48a 100644 (file)
@@ -20,7 +20,7 @@ use Catalyst::Test 'TestApp';
 {
     my $res = request('/emptybody');
     is $res->content, '';
-    ok !$res->header('Content-Length');
+    ok !defined $res->header('Content-Length');
 }
 
 done_testing;