Explicitely set uploaded image ACLs for S3 to "public-read" (#1371)

Explicitely set uploaded image ACLs for S3 to "public-read"
This commit is contained in:
Yukai Huang 2019-12-06 17:49:09 +08:00 committed by GitHub
commit b771baf7ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,7 +29,8 @@ exports.uploadImage = function (imagePath, callback) {
const params = { const params = {
Bucket: config.s3bucket, Bucket: config.s3bucket,
Key: path.join('uploads', path.basename(imagePath)), Key: path.join('uploads', path.basename(imagePath)),
Body: buffer Body: buffer,
ACL: 'public-read'
} }
const mimeType = getImageMimeType(imagePath) const mimeType = getImageMimeType(imagePath)