3 # This autohandler will spit out RT's images if the user hasn't
4 # properly configured their webserver to stop RT from passing
5 # images through the mason handler.
7 my $file = $m->base_comp->source_file;
8 my $type = "application/octet-stream";
10 if ($file =~ /\.(gif|png|jpe?g)$/i) {
12 $type =~ s/jpg/jpeg/gi;
15 die unless (-f $file && -r $file);
16 $r->content_type($type);
17 open (FILE, "<$file") || die;
18 $m->out($_) while (<FILE>);