summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2014-07-09 09:44:24 +0200
committerByron Jones <glob@mozilla.com>2014-07-09 09:44:24 +0200
commit3deb100b1d66fa2e4c9b8524d531f5c62aea0fa1 (patch)
tree5e5e709f59a1deabce833301abdd4b79a2021b2c /extensions
parent4c9f4e703dd840d58d7d2f6a4cd34ea72d891c9e (diff)
downloadbugzilla-3deb100b1d66fa2e4c9b8524d531f5c62aea0fa1.tar.gz
bugzilla-3deb100b1d66fa2e4c9b8524d531f5c62aea0fa1.tar.xz
Bug 1029500: bug.attachments shouldn't include attachment data by default
Diffstat (limited to 'extensions')
-rw-r--r--extensions/BzAPI/lib/Util.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/extensions/BzAPI/lib/Util.pm b/extensions/BzAPI/lib/Util.pm
index 2cbb078b8..c68592f70 100644
--- a/extensions/BzAPI/lib/Util.pm
+++ b/extensions/BzAPI/lib/Util.pm
@@ -328,8 +328,16 @@ sub fix_attachment {
}
}
- if ($data->{data}) {
+ if (exists $data->{data}) {
$data->{encoding} = $rpc->type('string', 'base64');
+ if ($params->{attachmentdata}
+ || filter_wants_nocache($params, 'attachments.data'))
+ {
+ $data->{encoding} = $rpc->type('string', 'base64');
+ }
+ else {
+ delete $data->{data};
+ }
}
if (exists $data->{bug_id}) {