Skip to content

Commit d768e9a

Browse files
Merge pull request #755 from topcoder-platform/feature/plat-3292
move file to the correct s3 bucket and constract aws s3 url sent to a…
2 parents 508e701 + 437ba06 commit d768e9a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/events/attachments/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ async function attachmentCreatedKafkaHandler(app, topic, payload) {
6666
if (result.error) {
6767
throw new Error(result.error);
6868
}
69+
const awsS3Url = `https://${config.get('attachmentsDMZS3Bucket')}.s3.amazonaws.com/${payload.path}`;
6970
const avScanPayload = {
70-
url: payload.path,
71+
url: awsS3Url,
7172
fileName: payload.path.split('/').pop(),
7273
moveFile: false,
7374
callbackOption: 'kafka',

src/routes/attachments/create.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ module.exports = [
7070

7171
const sourceBucket = data.s3Bucket;
7272
const sourceKey = data.path;
73-
const destBucket = config.get('attachmentsS3Bucket');
73+
const destBucket = config.get('attachmentsDMZS3Bucket');
7474
const destKey = path;
7575

7676
if (data.type === ATTACHMENT_TYPES.LINK) {

0 commit comments

Comments
 (0)