Skip to content

Commit

Permalink
Merge pull request #8658 from alphaprinz/notif_dfsbugs1286_backport518
Browse files Browse the repository at this point in the history
[Backport into 5.18] bucket notifications - get notif should clone result before altering it (dfsbugs 1286)
  • Loading branch information
nimrod-becker authored Jan 7, 2025
2 parents 55d3c09 + 0c99832 commit 79b62ac
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/endpoint/s3/ops/s3_get_bucket_notification.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
/* Copyright (C) 2016 NooBaa */
'use strict';

const _ = require('lodash');

/**
* http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETnotification.html
*/
async function get_bucket_notification(req) {

const result = await req.object_sdk.get_bucket_notification({
let result = await req.object_sdk.get_bucket_notification({
bucket_name: req.params.bucket,
});

result = _.cloneDeep(result);

//adapt to aws cli structure
if (result && result.length > 0) {
for (const conf of result) {
conf.Event = conf.event;
conf.Topic = conf.topic;
conf.Id = conf.id;
delete conf.vent;
delete conf.event;
delete conf.topic;
delete conf.id;
}
Expand Down

0 comments on commit 79b62ac

Please sign in to comment.