Skip to content

Commit 3f7fe02

Browse files
committed
Remove path.join on file upload key
1 parent caef96c commit 3f7fe02

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/s3.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,15 @@ module.exports = CoreObject.extend({
4444
var bucket = options.bucket;
4545
var acl = options.acl;
4646
var allowOverwrite = options.allowOverwrite;
47-
var key = path.join(options.prefix, options.filePattern + ":" + options.revisionKey);
47+
var key = options.filePattern + ":" + options.revisionKey;
48+
var revisionKey = joinUriSegments(options.prefix, key);
4849
var putObject = Promise.denodeify(client.putObject.bind(client));
4950
var gzippedFilePaths = options.gzippedFilePaths || [];
5051
var isGzipped = gzippedFilePaths.indexOf('index.html') !== -1;
5152

5253
var params = {
5354
Bucket: bucket,
54-
Key: key,
55+
Key: revisionKey,
5556
ACL: acl,
5657
ContentType: mime.lookup(options.filePath) || 'text/html',
5758
CacheControl: 'max-age=0, no-cache'
@@ -73,7 +74,7 @@ module.exports = CoreObject.extend({
7374
.then(function(fileContents) {
7475
params.Body = fileContents;
7576
return putObject(params).then(function() {
76-
plugin.log('✔ ' + key, { verbose: true });
77+
plugin.log('✔ ' + revisionKey, { verbose: true });
7778
});
7879
});
7980
},

0 commit comments

Comments
 (0)