File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -296,12 +296,12 @@ proto._getReqUrl = function _getReqUrl(params) {
296
296
copy ( this . options . endpoint ) . to ( ep ) ;
297
297
const isIP = this . _isIP ( ep . hostname ) ;
298
298
const isCname = this . options . cname ;
299
- if ( params . bucket && ! isCname && ! isIP ) {
299
+ if ( params . bucket && ! isCname && ! isIP && ! this . options . sldEnable ) {
300
300
ep . host = `${ params . bucket } .${ ep . host } ` ;
301
301
}
302
302
303
303
let resourcePath = '/' ;
304
- if ( params . bucket && isIP ) {
304
+ if ( params . bucket && ( this . options . sldEnable || isIP ) ) {
305
305
resourcePath += `${ params . bucket } /` ;
306
306
}
307
307
@@ -461,3 +461,8 @@ proto.requestError = async function requestError(result) {
461
461
debug ( 'generate error %j' , err ) ;
462
462
return err ;
463
463
} ;
464
+
465
+ proto . setSLDEnabled = function setSLDEnabled ( enable ) {
466
+ this . options . sldEnable = ! ! enable ;
467
+ return this ;
468
+ } ;
Original file line number Diff line number Diff line change @@ -46,7 +46,8 @@ module.exports = function (options) {
46
46
bucket : null ,
47
47
endpoint : null ,
48
48
cname : false ,
49
- isRequestPay : false
49
+ isRequestPay : false ,
50
+ sldEnable : false
50
51
} , options ) ;
51
52
52
53
opts . accessKeyId = opts . accessKeyId . trim ( ) ;
You can’t perform that action at this time.
0 commit comments