From cab5e09a3904889386b219f9144066098a69c21b Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Wed, 15 Apr 2009 09:45:40 +0000 Subject: Bug 486685: MIME type override for attachments lost in HTTP redirect - Patch by Frédéric Buclin r=wicked a=LpSolit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- attachment.cgi | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'attachment.cgi') diff --git a/attachment.cgi b/attachment.cgi index 53d189b93..f6549841f 100755 --- a/attachment.cgi +++ b/attachment.cgi @@ -252,6 +252,10 @@ sub view { my $bug_id = $attachment->bug_id; $attachbase =~ s/%bugid%/$bug_id/; my $path = 'attachment.cgi?id=' . $attachment->id; + # The user is allowed to override the content type of the attachment. + if (defined $cgi->param('content_type')) { + $path .= '&content_type=' . url_quote($cgi->param('content_type')); + } # Make sure the attachment is served from the correct server. if ($cgi->self_url !~ /^\Q$attachbase\E/) { -- cgit v1.2.3-24-g4f1b