Commit cab5e09a authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 486685: MIME type override for attachments lost in HTTP redirect - Patch by…

Bug 486685: MIME type override for attachments lost in HTTP redirect - Patch by Fré©ric Buclin <LpSolit@gmail.com> r=wicked a=LpSolit
parent e612c7ed
......@@ -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/) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment