[Catalyst] Bug in Catalyst::finalize_headers()

Andy Grundman andy at hybridized.org
Sun May 6 14:16:38 GMT 2007


On May 6, 2007, at 6:02 AM, 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 );
>   }

Yeah, I'll see about applying your patch so that in your case there  
would be no Content-Length set.

>
> 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!
>
> 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.

Yes this would be nice to have, although our dev server is only HTTP/ 
1.0.

-Andy




More information about the Catalyst mailing list