2 &RT::Interface::Web::StaticFileHeaders();
4 # This autohandler will spit out RT's images if the user hasn't
5 # properly configured their webserver to stop RT from passing
6 # images through the mason handler.
7 my $file = $m->base_comp->source_file;
10 my $type = "application/octet-stream";
11 if ($file =~ /\.(gif|png|jpe?g)$/i) {
13 $type =~ s/jpg/jpeg/gi;
16 die "file not found" unless -f $file && -r _;
18 $r->content_type($type);
19 open my $fh, "<$file" or die "couldn't open file: $!";
23 $m->out($_) while (<$fh>);