ghost-storage-adapter-s3-bartt
Advanced tools
Comparing version 0.1.3-development to 0.1.4-development
14
index.js
@@ -162,2 +162,4 @@ 'use strict'; | ||
saveRaw(buffer, fileName) { | ||
var that = this; | ||
if (!fileName.startsWith(this.pathPrefix)) { | ||
@@ -172,5 +174,5 @@ fileName = (0, _path.join)(this.pathPrefix, fileName); | ||
var config = { | ||
ACL: this.acl, | ||
ACL: that.acl, | ||
Body: buffer, | ||
Bucket: this.bucket, | ||
Bucket: that.bucket, | ||
CacheControl: `max-age=${30 * 24 * 60 * 60}`, | ||
@@ -180,7 +182,7 @@ ContentType: mimeType, | ||
}; | ||
if (this.serverSideEncryption !== '') { | ||
config.ServerSideEncryption = this.serverSideEncryption; | ||
if (that.serverSideEncryption !== '') { | ||
config.ServerSideEncryption = that.serverSideEncryption; | ||
} | ||
this.s3().putObject(config, function (err, data) { | ||
return err ? reject(err) : resolve(`${this.host}/${fileName}`); | ||
that.s3().putObject(config, function (err, data) { | ||
return err ? reject(err) : resolve(`${that.host}/${fileName}`); | ||
}); | ||
@@ -187,0 +189,0 @@ }); |
@@ -77,3 +77,3 @@ { | ||
}, | ||
"version": "0.1.3-development" | ||
"version": "0.1.4-development" | ||
} |
@@ -123,2 +123,4 @@ import AWS from 'aws-sdk' | ||
saveRaw (buffer, fileName) { | ||
const that = this | ||
if (!fileName.startsWith(this.pathPrefix)) { | ||
@@ -133,5 +135,5 @@ fileName = join(this.pathPrefix, fileName) | ||
var config = { | ||
ACL: this.acl, | ||
ACL: that.acl, | ||
Body: buffer, | ||
Bucket: this.bucket, | ||
Bucket: that.bucket, | ||
CacheControl: `max-age=${30 * 24 * 60 * 60}`, | ||
@@ -141,7 +143,7 @@ ContentType: mimeType, | ||
} | ||
if (this.serverSideEncryption !== '') { | ||
config.ServerSideEncryption = this.serverSideEncryption | ||
if (that.serverSideEncryption !== '') { | ||
config.ServerSideEncryption = that.serverSideEncryption | ||
} | ||
this.s3().putObject(config, function (err, data) { | ||
return err ? reject(err) : resolve(`${this.host}/${fileName}`) | ||
that.s3().putObject(config, function (err, data) { | ||
return err ? reject(err) : resolve(`${that.host}/${fileName}`) | ||
}) | ||
@@ -148,0 +150,0 @@ }) |
29014
358