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

Carl Franks fireartist at gmail.com
Thu Feb 23 16:20:23 CET 2006


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 {



More information about the Catalyst mailing list