diff --git a/src/endpoint/s3/ops/s3_get_bucket_notification.js b/src/endpoint/s3/ops/s3_get_bucket_notification.js index b5a2d9c021..a992051b72 100644 --- a/src/endpoint/s3/ops/s3_get_bucket_notification.js +++ b/src/endpoint/s3/ops/s3_get_bucket_notification.js @@ -16,23 +16,28 @@ async function get_bucket_notification(req) { conf.Event = conf.event; conf.Topic = conf.topic; conf.Id = conf.id; - delete conf.vent; + delete conf.event; delete conf.topic; delete conf.id; } } + const TopicConfiguration = []; + if (result && result.length > 0) { + for (const conf of result) { + 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; }