Skip to content

Commit dd2f2e9

Browse files
committed
Remove uploadParams helper
1 parent 1b0c642 commit dd2f2e9

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

index.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ S3BlobStore.prototype.createWriteStream = function (opts, s3opts, done) {
5353
s3opts = {};
5454
}
5555
if (typeof opts === 'string') opts = { key: opts };
56-
var params = this.uploadParams(opts, s3opts);
56+
var params = this._s3params(opts, s3opts);
57+
var contentType = (opts && opts.contentType) || mime.lookup(params.Key);
58+
if (contentType) params.ContentType = contentType;
5759
var out = uploadStream(this.s3, params);
5860
out.on('error', function (err) {
5961
debug('got err %j', err);
@@ -102,15 +104,6 @@ S3BlobStore.prototype.exists = function (opts, s3opts, done) {
102104
});
103105
};
104106

105-
S3BlobStore.prototype.uploadParams = function (opts, s3opts) {
106-
opts = opts || {};
107-
var key = opts.key || opts.name || opts.filename;
108-
var params = this._s3params(opts, s3opts);
109-
var contentType = opts.contentType || mime.lookup(key);
110-
if (contentType) params.ContentType = contentType;
111-
return params;
112-
};
113-
114107
S3BlobStore.prototype._s3params = function (opts, s3opts) {
115108
opts = opts || {};
116109
opts.params = s3opts || opts.params || {};

0 commit comments

Comments
 (0)