Skip to content

Commit 37154c6

Browse files
authored
bucket notifications - get notif should clone result before altering it (dfsbugs 1286) (#8657)
Signed-off-by: Amit Prinz Setter <alphaprinz@gmail.com>
1 parent 5c4b49b commit 37154c6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/endpoint/s3/ops/s3_get_bucket_notification.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
/* Copyright (C) 2016 NooBaa */
22
'use strict';
33

4+
const _ = require('lodash');
5+
46
/**
57
* http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETnotification.html
68
*/
79
async function get_bucket_notification(req) {
810

9-
const result = await req.object_sdk.get_bucket_notification({
11+
let result = await req.object_sdk.get_bucket_notification({
1012
bucket_name: req.params.bucket,
1113
});
1214

15+
result = _.cloneDeep(result);
16+
1317
//adapt to aws cli structure
1418
if (result && result.length > 0) {
1519
for (const conf of result) {
1620
conf.Event = conf.event;
1721
conf.Topic = conf.topic;
1822
conf.Id = conf.id;
19-
delete conf.vent;
23+
delete conf.event;
2024
delete conf.topic;
2125
delete conf.id;
2226
}

0 commit comments

Comments
 (0)