[Rt-commit] r17406 - in rt/3.8/trunk: lib/RT/Interface/Web/Mason

falcone at bestpractical.com falcone at bestpractical.com
Mon Dec 29 15:52:55 EST 2008


Author: falcone
Date: Mon Dec 29 15:52:54 2008
New Revision: 17406

Modified:
   rt/3.8/trunk/   (props changed)
   rt/3.8/trunk/lib/RT/Interface/Web/Mason/CGIHandler.pm

Log:
 r42932 at ketch:  falcone | 2008-12-29 15:51:21 -0500
 * this blew up serving images out of plugin dirs
 * use CGI to generate the header instead


Modified: rt/3.8/trunk/lib/RT/Interface/Web/Mason/CGIHandler.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/Interface/Web/Mason/CGIHandler.pm	(original)
+++ rt/3.8/trunk/lib/RT/Interface/Web/Mason/CGIHandler.pm	Mon Dec 29 15:52:54 2008
@@ -12,15 +12,12 @@
     my ($self, $cgi) = @_;
 
     if (my ($file, $type) = $self->image_file_request($cgi->path_info)) {
-        print "HTTP/1.0 200 OK\x0d\x0a";
-        print "Content-Type: $type\x0d\x0a";
-        print "Content-Length: " . (-s $file) . "\x0d\x0a\x0d\x0a";
+        print $cgi->header(-type => $type,
+                           -Content_length => (-s $file) );
         open my $fh, "<$file" or die "Can't open $file: $!";
         binmode($fh);
-        {
-            local $/ = \16384;
-            print $_ while <$fh>;
-        }
+        local $/ = \16384;
+        print $_ while <$fh>;
         close $fh;
         return;
     }


More information about the Rt-commit mailing list