Skip to content

Commit e1e33b6

Browse files
committed
Merge pull request #1 from firesh/master
修复当option.prefix=''的时候,报SignatureDoesNotMatch错误的问题
2 parents 044002f + c26b8ec commit e1e33b6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ gulp.task('oss', function(){
1515
secretAccessKey: '*********',
1616
endpoint: 'http://oss-cn-***.aliyuncs.com',
1717
apiVersion: '2013-10-15',
18-
prefix: 'assets/js',
18+
prefix: 'assets/js', //for no prefix: prefix: ''
1919
bucket: 'test'
2020
};
2121
//./js/a.js -> <prefix>/a.js

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function oss(option) {
3939
}
4040
var getFileKey = function(){
4141
return option.prefix
42-
+ ((!option.prefix || option.prefix[option.prefix.length - 1]) === '/' ? '' : '/')
42+
+ ((!option.prefix || (option.prefix[option.prefix.length - 1]) === '/') ? '' : '/')
4343
+ (option.versioning ? version + '/' : '')
4444
+ path.relative(file.base, file.path);
4545
};

0 commit comments

Comments
 (0)