summaryrefslogtreecommitdiffstats
path: root/attachment.cgi
diff options
context:
space:
mode:
authorjustdave%syndicomm.com <>2002-09-28 13:10:27 +0200
committerjustdave%syndicomm.com <>2002-09-28 13:10:27 +0200
commit90975fe914d066726d06f53abe8696399b13a61a (patch)
treeb82bce16d571c593fe2406eabe9a5cc346304567 /attachment.cgi
parentb771be6f8820b5a5436c3cb4b188f4f9d9594810 (diff)
downloadbugzilla-90975fe914d066726d06f53abe8696399b13a61a.tar.gz
bugzilla-90975fe914d066726d06f53abe8696399b13a61a.tar.xz
Fix for bug 171296: changing Content-disposition header in attachment.cgi to use 'inline' instead of 'attachment' so that it
doesn't *force* you to download it. r= bbaetz, bzbarsky
Diffstat (limited to 'attachment.cgi')
-rwxr-xr-xattachment.cgi8
1 files changed, 1 insertions, 7 deletions
diff --git a/attachment.cgi b/attachment.cgi
index cfdbd4ea6..4d5fea475 100755
--- a/attachment.cgi
+++ b/attachment.cgi
@@ -342,17 +342,11 @@ sub view
SendSQL("SELECT mimetype, filename, thedata FROM attachments WHERE attach_id = $::FORM{'id'}");
my ($contenttype, $filename, $thedata) = FetchSQLData();
- # Determine if the browser supports the Content-Disposition header or not
- my $usedisposition = 1; # assume yes, unless we discover otherwise
- if ($::ENV{HTTP_USER_AGENT} =~ /^Mozilla.*MSIE (\d+)/) {
- if ($1 < 5) { $usedisposition = 0; } # MSIE < 5.0 chokes on it
- }
-
# Return the appropriate HTTP response headers.
$filename =~ s/^.*[\/\\]//;
my $filesize = length($thedata);
print qq{Content-Type: $contenttype; name="$filename"\n};
- print qq{Content-Disposition: attachment; filename=$filename\n} if $usedisposition;
+ print qq{Content-Disposition: inline; filename=$filename\n};
print qq{Content-Length: $filesize\n};
print qq{\n$thedata};