Skip to content

Commit a4895f2

Browse files
committed
feat: allow s3 to write objects without ACL (also fix JSDoc)
1 parent ad7fc63 commit a4895f2

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

aws/S3Provider.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,9 @@ module.exports = (() => {
224224
* @public
225225
* @async
226226
* @param {string} filename
227-
* @param {string|Buffer} buffer - The content to upload
228-
* @param {string=} mimeType = Defaults to "text/plain"
229-
* @param {boolean=} secure = Indicates if the "private" ACL applies to the object
227+
* @param {string|Buffer|Object} content - The content to upload
228+
* @param {string=} mimeType - Defaults to "text/plain"
229+
* @param {boolean=} secure - Indicates if the "private" ACL applies to the object
230230
* @returns {Promise<Object>}
231231
*/
232232
async upload(filename, content, mimeType, secure) {
@@ -240,9 +240,9 @@ module.exports = (() => {
240240
* @async
241241
* @param {string} bucket
242242
* @param {string} filename
243-
* @param {string|Buffer} buffer - The content to upload
244-
* @param {string=} mimeType = Defaults to "text/plain"
245-
* @param {boolean=} secure = Indicates if the "private" ACL applies to the object
243+
* @param {string|Buffer|Object} content - The content to upload
244+
* @param {string=} mimeType - Defaults to "text/plain"
245+
* @param {boolean|string=} secure - Indicates if the "private" ACL applies to the object
246246
* @returns {Promise<Object>}
247247
*/
248248
async uploadObject(bucket, filename, content, mimeType, secure) {
@@ -277,6 +277,10 @@ module.exports = (() => {
277277
ContentType: mimeTypeToUse
278278
});
279279

280+
if (acl === 'none') {
281+
delete params.ACL;
282+
}
283+
280284
const options = {
281285
partSize: 10 * 1024 * 1024,
282286
queueSize: 1

0 commit comments

Comments
 (0)