Skip to content

Commit

Permalink
Fix up disposition type in attachments for http_send()
Browse files Browse the repository at this point in the history
  • Loading branch information
pudge committed Feb 8, 2005
1 parent 581413c commit 9ca7190
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Slash/Utility/Anchor/Anchor.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -280,7 +280,11 @@ sub http_send {
if ($opt->{filename}) { if ($opt->{filename}) {
$opt->{filename} =~ s/[^\w_.-]/_/g; $opt->{filename} =~ s/[^\w_.-]/_/g;
my $val = "filename=$opt->{filename}"; my $val = "filename=$opt->{filename}";
$val = "attachment; $val" if $opt->{attachment}; # none by default, MSIE etc. had problems?
if ($opt->{dis_type}) {
$opt->{dis_type} =~ s/\W+//;
$val = "$opt->{dis_type}; $val";
}
$r->header_out('Content-Disposition', $val); $r->header_out('Content-Disposition', $val);
} }


Expand Down
1 change: 1 addition & 0 deletions Slash/XML/XML.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ sub xmlDisplay {
content_type => 'text/xml', content_type => 'text/xml',
filename => $opt->{filename}, filename => $opt->{filename},
etag => md5_hex($temp), etag => md5_hex($temp),
dis_type => 'inline',
content => $content content => $content
}); });
} }
Expand Down
5 changes: 5 additions & 0 deletions plugins/Blob/blob.pl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ sub main {
content_type => $data->{content_type}, content_type => $data->{content_type},
filename => $data->{filename}, filename => $data->{filename},
do_etag => 1, do_etag => 1,
dis_type => 'inline', # best to default to inline,
# users can choose to download
# if they wish, and most file
# types will auto-download anyway,
# even if set to inline
content => $data->{data} content => $data->{data}
}); });
} }
Expand Down
1 change: 1 addition & 0 deletions plugins/PubKey/pubkey.pl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ sub main {
content_type => 'text/plain', content_type => 'text/plain',
filename => "pubkey-$uid.asc", filename => "pubkey-$uid.asc",
do_etag => 1, do_etag => 1,
dis_type => 'inline',
content => $content content => $content
}); });
} }
Expand Down
3 changes: 2 additions & 1 deletion plugins/Stats/stats.pl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ sub csv {
http_send({ http_send({
content_type => 'text/csv', content_type => 'text/csv',
filename => $filename, filename => $filename,
attachment => 1,
do_etag => 1, do_etag => 1,
dis_type => 'attachment',
content => $content content => $content
}); });
} }
Expand Down Expand Up @@ -198,6 +198,7 @@ sub graph {
content_type => $type, content_type => $type,
filename => $filename, filename => $filename,
do_etag => 1, do_etag => 1,
dis_type => 'inline',
content => $content content => $content
}); });
} }
Expand Down

0 comments on commit 9ca7190

Please sign in to comment.