File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -161,8 +161,11 @@ const patchProviderCredentials = (provider) => {
161161 const result = await origConstr ( options ) ;
162162 result . sdkOptions = result . sdkOptions || { } ; // legacy
163163 await setSdkOptions ( result . sdkOptions ) ; // legacy
164- result . requestHandler . endpoint = localEndpoint ;
165- result . requestHandler . forcePathStyle = true ;
164+ // >= 2.167.0
165+ if ( result . requestHandler ) {
166+ result . requestHandler . endpoint = localEndpoint ;
167+ result . requestHandler . forcePathStyle = true ;
168+ }
166169 return result ;
167170 } ;
168171
@@ -372,7 +375,8 @@ const patchSdkProvider = (provider, SDK) => {
372375 provider . SdkProvider . prototype [ methodName ] = async function methFunc ( ...args ) {
373376 const localEndpoint = await getLocalEndpoint ( ) ;
374377
375- if ( ! sdkOverwritten ) {
378+ // patch for >= 2.167.0
379+ if ( ! sdkOverwritten && this . requestHandler ) {
376380 // the goal is to support `SdkProvider.withAssumedRole`
377381 // since it instantiates a different client (i.e. not from the SDK class)
378382 this . requestHandler . endpoint = localEndpoint ;
You can’t perform that action at this time.
0 commit comments