X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst.pm;h=809d2a4e08b9758d4c323e268b5ebd9b5343e40e;hp=40791cdf403a48a3403fc11aa110f754d9de3ac7;hb=3b6a1db18241beccccb477ffd5f3abeaaff35418;hpb=9b98464223828a695cc4aadcf597fb118c10b571 diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 40791cd..809d2a4 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -1427,7 +1427,8 @@ sub finalize_headers { # get the length from a filehandle if ( blessed( $c->response->body ) && $c->response->body->can('read') ) { - if ( my $stat = stat $c->response->body ) { + my $stat = stat $c->response->body; + if ( $stat && $stat->size > 0 ) { $c->response->content_length( $stat->size ); } else {