[Catalyst] p-static-simple line-ending patch

Andy Grundman andy at hybridized.org
Thu Feb 23 16:58:31 CET 2006


Carl Franks wrote:
> I've been having problems serving static files relating to newlines.
> 
> I'm on windows. When I serve css files with unix line-endings, firefox
> cuts off the end of the file.
> I'm guessing it's to do with whether a line-ending counts as 1 or 2 bytes.
> 
> I don't know what this'll do for other platforms, but it does solve
> the error I'm seeing.
> It could maybe be expanded for some other types (xml?), but it's a start.
> 
> Carl
> 
> This is against revision 3461:
> 
> @@ -185,7 +185,7 @@
>          # new method, pass an IO::File object to body
>          my $fh = IO::File->new( $full_path, 'r' );
>          if ( defined $fh ) {
> -            binmode $fh;
> +            $fh->binmode unless $type =~ /^text\//;
>              $c->res->body( $fh );
>          }
>          else {
> 

What will this do on text files with DOS line-endings?

-Andy



More information about the Catalyst mailing list