diff options
author | ivan <ivan> | 2008-03-02 04:06:06 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-03-02 04:06:06 +0000 |
commit | 5e05724a635a22776f1b973f5d7e77989da4e048 (patch) | |
tree | 8c9155a06d82fd0fac65300ce8ca8f51e73d6afc /rt/html/NoAuth/images/autohandler | |
parent | 807bc6bf91e6208fd40bcdf99ce4c0149c2598d2 (diff) | |
parent | 9c68254528b6f2c7d8c1921b452fa56064783782 (diff) |
This commit was generated by cvs2svn to compensate for changes in r6252,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'rt/html/NoAuth/images/autohandler')
-rw-r--r-- | rt/html/NoAuth/images/autohandler | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/rt/html/NoAuth/images/autohandler b/rt/html/NoAuth/images/autohandler index 720979830..2e428c157 100644 --- a/rt/html/NoAuth/images/autohandler +++ b/rt/html/NoAuth/images/autohandler @@ -1,28 +1,24 @@ -<%INIT> -&RT::Interface::Web::StaticFileHeaders(); +<%init> # This autohandler will spit out RT's images if the user hasn't # properly configured their webserver to stop RT from passing # images through the mason handler. -my $file = $m->base_comp->source_file; - +my $file = $m->base_comp->source_file; my $type = "application/octet-stream"; + if ($file =~ /\.(gif|png|jpe?g)$/i) { $type = "image/$1"; $type =~ s/jpg/jpeg/gi; } -die "file not found" unless -f $file && -r _; - +die unless (-f $file && -r $file); $r->content_type($type); -open my $fh, "<$file" or die "couldn't open file: $!"; -binmode($fh); +open (FILE, "<$file") || die; { local $/ = \16384; - $m->out($_) while (<$fh>); - $m->flush_buffer; + $m->out($_) while (<FILE>); + close(FILE); } -close $fh; $m->abort; -</%INIT> +</%init> |