From 27fd10f2a6c76fbf751cb76a8973be68971c4088 Mon Sep 17 00:00:00 2001 From: Jori Lallo Date: Sun, 29 Oct 2017 23:52:09 -0700 Subject: [PATCH] Prefix s3 user uploads with `uploads/` --- server/api/user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/api/user.js b/server/api/user.js index a68dcedc..15e4ed6b 100644 --- a/server/api/user.js +++ b/server/api/user.js @@ -18,7 +18,7 @@ router.post('user.s3Upload', auth(), async ctx => { ctx.assertPresent(size, 'size is required'); const s3Key = uuid.v4(); - const key = `${s3Key}/${filename}`; + const key = `uploads/${s3Key}/${filename}`; const policy = makePolicy(); ctx.body = { @@ -36,7 +36,7 @@ router.post('user.s3Upload', auth(), async ctx => { }, asset: { contentType: kind, - url: `${process.env.AWS_S3_UPLOAD_BUCKET_URL}${s3Key}/${filename}`, + url: `${process.env.AWS_S3_UPLOAD_BUCKET_URL}${key}`, name: filename, size, },