diff --git a/src/endpoint/s3/ops/s3_get_bucket_notification.js b/src/endpoint/s3/ops/s3_get_bucket_notification.js index 5106ce91ff..b18dcf0623 100644 --- a/src/endpoint/s3/ops/s3_get_bucket_notification.js +++ b/src/endpoint/s3/ops/s3_get_bucket_notification.js @@ -13,6 +13,8 @@ async function get_bucket_notification(req) { }); result = _.cloneDeep(result); + + const TopicConfiguration = []; //adapt to aws cli structure if (result && result.length > 0) { @@ -23,20 +25,20 @@ async function get_bucket_notification(req) { delete conf.event; delete conf.topic; delete conf.id; + + TopicConfiguration.push({TopicConfiguration: conf}); } } const reply = result && result.length > 0 ? { //return result inside TopicConfiguration tag - NotificationConfiguration: { - TopicConfiguration: result - } + NotificationConfiguration: + TopicConfiguration } : //if there's no notification, return empty NotificationConfiguration tag { NotificationConfiguration: {} }; - return reply; }