Skip to content

Commit 1e18606

Browse files
committed
upd:删掉重复代码
1 parent a57753f commit 1e18606

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

sdk/base.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3133,20 +3133,14 @@ function getObjectUrl(params, callback) {
31333133
queryParamsStr += (queryParamsStr ? '&' : '') + params.QueryString;
31343134
}
31353135

3136-
// 签名加上 Host,避免跨桶访问
3137-
var SignHost = '';
3138-
var standardHost = 'cos.' + params.Region + '.myqcloud.com';
3139-
if (!self.options.ForcePathStyle) standardHost = params.Bucket + '.' + standardHost;
3140-
var urlHost = url.replace(/^https?:\/\/([^/]+)(\/.*)?$/, '$1');
3141-
if (standardHost === urlHost) SignHost = standardHost;
3142-
31433136
var syncUrl = url;
31443137
if (params.Sign !== undefined && !params.Sign) {
31453138
queryParamsStr && (syncUrl += '?' + queryParamsStr);
31463139
callback(null, {Url: syncUrl});
31473140
return syncUrl;
31483141
}
31493142

3143+
// 签名加上 Host,避免跨桶访问
31503144
var SignHost = getSignHost.call(this, {Bucket: params.Bucket, Region: params.Region, Url: url});
31513145
var AuthData = getAuthorizationAsync.call(this, {
31523146
Action: ((params.Method || '').toUpperCase() === 'PUT' ? 'name/cos:PutObject' : 'name/cos:GetObject'),

0 commit comments

Comments
 (0)