[Catalyst] Bug in Catalyst::finalize_headers()

Matt S Trout dbix-class at trout.me.uk
Mon May 7 13:16:34 GMT 2007


On Sun, May 06, 2007 at 12:02:51PM +0200, Bernhard Graf wrote:
> This header line is automatically created by this code in 
> Catalyst::finalize_headers():
> 
>   if ( my $stat = stat $c->response->body ) {
>       $c->response->content_length( $stat->size );
>   }
> 
> Apparently this assumes that $c->response->body is a filehandle of a 
> regular file, but you can stat any kind of file (remember: "in UNIX 
> everything is a file") and for a pipe $stat->size is 0!

Nice spot.
 
> I fixed the code and now it works as expected, though chunked 
> transfer coding*) would be a nice feature in the absence of a 
> Content-Length header.
> 
> A patch against the svn trunk is attached.

You seem to have only sent half the patch - could you try re-sending it and
make sure the test is attached this time please?



More information about the Catalyst mailing list