From d39d52aac8f38ea9115628039f0df5aa3ac826de Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 3 Dec 2004 20:40:48 +0000 Subject: import rt 3.2.2 --- rt/html/NoAuth/images/autohandler | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 rt/html/NoAuth/images/autohandler (limited to 'rt/html/NoAuth/images/autohandler') diff --git a/rt/html/NoAuth/images/autohandler b/rt/html/NoAuth/images/autohandler new file mode 100644 index 000000000..86f3b2286 --- /dev/null +++ b/rt/html/NoAuth/images/autohandler @@ -0,0 +1,21 @@ +<%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 $type = "application/octet-stream"; + +if ($file =~ /\.(gif|png|jpe?g)$/i) { + $type = "image/$1"; + $type =~ s/jpg/jpeg/gi; +} + +die unless (-f $file && -r $file); +$r->content_type($type); +open (FILE, "<$file") || die; +$m->out($_) while (); +close(FILE); +$m->abort; + -- cgit v1.2.1 From d4d0590bef31071e8809ec046717444b95b3f30a Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 15 Oct 2005 09:11:20 +0000 Subject: import rt 3.4.4 --- rt/html/NoAuth/images/autohandler | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'rt/html/NoAuth/images/autohandler') diff --git a/rt/html/NoAuth/images/autohandler b/rt/html/NoAuth/images/autohandler index 86f3b2286..2e428c157 100644 --- a/rt/html/NoAuth/images/autohandler +++ b/rt/html/NoAuth/images/autohandler @@ -15,7 +15,10 @@ if ($file =~ /\.(gif|png|jpe?g)$/i) { die unless (-f $file && -r $file); $r->content_type($type); open (FILE, "<$file") || die; -$m->out($_) while (); -close(FILE); +{ + local $/ = \16384; + $m->out($_) while (); + close(FILE); +} $m->abort; -- cgit v1.2.1