Skip to content

Commit fa24e9b

Browse files
authored
bucket notifications - fix TopicConfiguration array for get (github issue 8647) (#8655)
Signed-off-by: Amit Prinz Setter <alphaprinz@gmail.com>
1 parent 37154c6 commit fa24e9b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/endpoint/s3/ops/s3_get_bucket_notification.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ async function get_bucket_notification(req) {
1414

1515
result = _.cloneDeep(result);
1616

17+
const TopicConfiguration = [];
18+
1719
//adapt to aws cli structure
1820
if (result && result.length > 0) {
1921
for (const conf of result) {
@@ -23,20 +25,20 @@ async function get_bucket_notification(req) {
2325
delete conf.event;
2426
delete conf.topic;
2527
delete conf.id;
28+
29+
TopicConfiguration.push({TopicConfiguration: conf});
2630
}
2731
}
2832

2933
const reply = result && result.length > 0 ?
3034
{
3135
//return result inside TopicConfiguration tag
32-
NotificationConfiguration: {
33-
TopicConfiguration: result
34-
}
36+
NotificationConfiguration:
37+
TopicConfiguration
3538
} :
3639
//if there's no notification, return empty NotificationConfiguration tag
3740
{ NotificationConfiguration: {} };
3841

39-
4042
return reply;
4143
}
4244

0 commit comments

Comments
 (0)