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
1 changed files with 2 additions and 1 deletions

View File

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