Skip to content

Commit

Permalink
bucket notifications - get notif should clone result before altering …
Browse files Browse the repository at this point in the history
…it (dfsbugs 1286) (#8657)

Signed-off-by: Amit Prinz Setter <[email protected]>
  • Loading branch information
alphaprinz authored Jan 7, 2025
1 parent 5c4b49b commit 37154c6
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 37154c6

Please sign in to comment.