pass filename (it is not part of the config!)
This commit is contained in:
@@ -79,9 +79,10 @@ function getSignedUploadUrl(apiConfig, filename, callback) {
|
||||
});
|
||||
}
|
||||
|
||||
function getSignedDownloadUrl(apiConfig, info, callback) {
|
||||
function getSignedDownloadUrl(apiConfig, info, filename, callback) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
assert.strictEqual(typeof info, 'object');
|
||||
assert.strictEqual(typeof filename, 'string');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
if (!info.bucket || !info.prefix) return new Error('Invalid configuration'); // prevent error in s3
|
||||
@@ -93,7 +94,7 @@ function getSignedDownloadUrl(apiConfig, info, callback) {
|
||||
|
||||
var params = {
|
||||
Bucket: info.bucket,
|
||||
Key: info.prefix + '/' + info.filename,
|
||||
Key: info.prefix + '/' + filename,
|
||||
Expires: 60 * 30 /* 30 minutes */
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user