]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 486685: MIME type override for attachments lost in HTTP redirect - Patch by FrÃ...
authorlpsolit%gmail.com <>
Wed, 15 Apr 2009 09:49:44 +0000 (09:49 +0000)
committerlpsolit%gmail.com <>
Wed, 15 Apr 2009 09:49:44 +0000 (09:49 +0000)
attachment.cgi

index 53fe4a6d0cf09368e2ece88f5df93837fd867be9..1f5dd1e52d751c7b37ffc705a0c19482763e8390 100755 (executable)
@@ -324,6 +324,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/) {