Skip to content

Commit

Permalink
fix(region_config): remove mutation of global signatureVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe committed Nov 28, 2022
1 parent 44bf65a commit 427c41d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/region_config.js
Expand Up @@ -64,11 +64,18 @@ function configureEndpoint(service) {

// signature version
if (!config.signatureVersion) {
config.signatureVersion = (service.api && service.api.signatureVersion) || 'v4';
// Note: config is a global object and should not be mutated here.
// However, we are retaining this line for backwards compatibility.
// The non-v4 signatureVersion will be set in a copied object below.
config.signatureVersion = 'v4';
}

// merge config
applyConfig(service, config);
applyConfig(service, Object.assign(
{},
config,
{ signatureVersion: (service.api && service.api.signatureVersion) || 'v4' }
));
return;
}
}
Expand Down

0 comments on commit 427c41d

Please sign in to comment.