@@ -3923,7 +3923,7 @@ function allowRetry(err) {
39233923 networkError = true ;
39243924 } else {
39253925 const statusCode = Math . floor ( err . statusCode / 100 ) ;
3926- const requestId = err ? .headers && err ? .headers [ 'x-cos-request-id' ] ;
3926+ const requestId = err . headers ? err . headers [ 'x-cos-request-id' ] : '' ;
39273927 if ( [ 3 , 4 , 5 ] . includes ( statusCode ) && ! requestId ) {
39283928 canRetry = self . options . AutoSwitchHost ;
39293929 networkError = true ;
@@ -4017,17 +4017,17 @@ function submitRequest(params, callback) {
40174017 }
40184018 // 进入重试逻辑时 需判断是否需要切换cos备用域名
40194019 const switchHost = canSwitchHost . call ( self , {
4020- requestUrl : err ? .url || '' ,
4021- clientCalcSign : AuthData ? .SignFrom === 'client' ,
4020+ requestUrl : err . url || '' ,
4021+ clientCalcSign : AuthData . SignFrom === 'client' ,
40224022 networkError,
40234023 } ) ;
40244024 params . SwitchHost = switchHost ;
40254025 next ( tryTimes + 1 ) ;
40264026 } else {
40274027 if ( err && params . Action === 'name/cos:UploadPart' ) {
40284028 const switchHost = canSwitchHost . call ( self , {
4029- requestUrl : err ? .url || '' ,
4030- clientCalcSign : AuthData ? .SignFrom === 'client' ,
4029+ requestUrl : err . url || '' ,
4030+ clientCalcSign : AuthData . SignFrom === 'client' ,
40314031 networkError,
40324032 } ) ;
40334033 err . switchHost = switchHost ;
0 commit comments