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) => {
161
161
const result = await origConstr ( options ) ;
162
162
result . sdkOptions = result . sdkOptions || { } ; // legacy
163
163
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
+ }
166
169
return result ;
167
170
} ;
168
171
@@ -372,7 +375,8 @@ const patchSdkProvider = (provider, SDK) => {
372
375
provider . SdkProvider . prototype [ methodName ] = async function methFunc ( ...args ) {
373
376
const localEndpoint = await getLocalEndpoint ( ) ;
374
377
375
- if ( ! sdkOverwritten ) {
378
+ // patch for >= 2.167.0
379
+ if ( ! sdkOverwritten && this . requestHandler ) {
376
380
// the goal is to support `SdkProvider.withAssumedRole`
377
381
// since it instantiates a different client (i.e. not from the SDK class)
378
382
this . requestHandler . endpoint = localEndpoint ;
You can’t perform that action at this time.
0 commit comments