diff options
author | Byron Jones <glob@mozilla.com> | 2014-07-09 09:44:24 +0200 |
---|---|---|
committer | Byron Jones <glob@mozilla.com> | 2014-07-09 09:44:24 +0200 |
commit | 3deb100b1d66fa2e4c9b8524d531f5c62aea0fa1 (patch) | |
tree | 5e5e709f59a1deabce833301abdd4b79a2021b2c /extensions | |
parent | 4c9f4e703dd840d58d7d2f6a4cd34ea72d891c9e (diff) | |
download | bugzilla-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.pm | 10 |
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}) { |