From 3deb100b1d66fa2e4c9b8524d531f5c62aea0fa1 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Wed, 9 Jul 2014 15:44:24 +0800 Subject: Bug 1029500: bug.attachments shouldn't include attachment data by default --- extensions/BzAPI/lib/Util.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'extensions') 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}) { -- cgit v1.2.3-24-g4f1b