diff --git a/src/endpoint/s3/ops/s3_get_bucket_notification.js b/src/endpoint/s3/ops/s3_get_bucket_notification.js index 5106ce91ff..78a1f93ae0 100644 --- a/src/endpoint/s3/ops/s3_get_bucket_notification.js +++ b/src/endpoint/s3/ops/s3_get_bucket_notification.js @@ -14,6 +14,8 @@ async function get_bucket_notification(req) { result = _.cloneDeep(result); + const TopicConfiguration = []; + //adapt to aws cli structure if (result && result.length > 0) { for (const conf of result) { @@ -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; }