diff --git a/lib/read-stream.js b/lib/read-stream.js index f026dcf..717e167 100644 --- a/lib/read-stream.js +++ b/lib/read-stream.js @@ -42,7 +42,7 @@ module.exports = function createReadStream(options) { buffer: true, read: true, awsOptions: { }, - s3: new AWS.S3() + s3: options.s3 || new AWS.S3() }, options); if (!options.s3 || !_.isFunction(options.s3.getObject)) { diff --git a/lib/write-stream.js b/lib/write-stream.js index 840b041..425815d 100644 --- a/lib/write-stream.js +++ b/lib/write-stream.js @@ -32,7 +32,7 @@ var encodings = { module.exports = function createWriteStream(root, options) { options = _.assign({ - s3: new AWS.S3(), + s3: options.s3 || new AWS.S3(), awsOptions: { } }, options);