From: David Kamholz Date: Wed, 1 Mar 2006 05:44:35 +0000 (+0000) Subject: fix silly bug in finalize_headers X-Git-Tag: 5.7099_04~685 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=6a4a70024f8ebdb5719a55f3da00cb938cbd24d8 fix silly bug in finalize_headers --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 4e63635..8290074 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -17,7 +17,7 @@ use Text::SimpleTable; use Path::Class; use Time::HiRes qw/gettimeofday tv_interval/; use URI; -use Scalar::Util qw/weaken/; +use Scalar::Util qw/weaken blessed/; use Tree::Simple qw/use_weak_refs/; use Tree::Simple::Visitor::FindByUID; use attributes; @@ -1165,7 +1165,7 @@ sub finalize_headers { if ( $c->response->body && !$c->response->content_length ) { # get the length from a filehandle - if ( ref $c->response->body && $c->response->body->can('read') ) { + if ( blessed($c->response->body) && $c->response->body->can('read') ) { if ( my $stat = stat $c->response->body ) { $c->response->content_length( $stat->size ); }