Skip to content

Commit

Permalink
Merge 2cc6397 into c27c1f0
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Kanter committed Mar 11, 2016
2 parents c27c1f0 + 2cc6397 commit dbd738a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/S3.js
Expand Up @@ -18,6 +18,10 @@ var S3StorageProvider = function (options) {
if (!this._options.region) {
this._options.region = 'us-standard'
}

if (!this._options.customHeaders) {
this._options.customHeaders = {};
}

if (typeof this._options.path !== 'function') {
this._options.path = function (attachment) {
Expand All @@ -35,9 +39,10 @@ var S3StorageProvider = function (options) {

S3StorageProvider.prototype.save = function (attachment, callback) {
var self = this
var headers = this._options.customHeaders;
headers['x-amz-acl'] = this._options.acl;

this._client.putFile(attachment.path, this._options.path(attachment),
{'x-amz-acl': this._options.acl }, function (error, res) {
this._client.putFile(attachment.path, this._options.path(attachment), headers, function (error, res) {
self._queryResult(error, res, callback)
})
}
Expand Down

0 comments on commit dbd738a

Please sign in to comment.