summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2009-04-15 11:45:40 +0200
committerlpsolit%gmail.com <>2009-04-15 11:45:40 +0200
commitcab5e09a3904889386b219f9144066098a69c21b (patch)
treed0eef9f6673662debc1edd4607e903611f7737de
parente612c7edbe651bbfced5fc6504e6bf9be0bb8ee1 (diff)
downloadbugzilla-cab5e09a3904889386b219f9144066098a69c21b.tar.gz
bugzilla-cab5e09a3904889386b219f9144066098a69c21b.tar.xz
Bug 486685: MIME type override for attachments lost in HTTP redirect - Patch by Frédéric Buclin <LpSolit@gmail.com> r=wicked a=LpSolit
-rwxr-xr-xattachment.cgi4
1 files changed, 4 insertions, 0 deletions
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/) {