Skip to content

Commit 427c41d

Browse files
committed
fix(region_config): remove mutation of global signatureVersion
1 parent 44bf65a commit 427c41d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/region_config.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,18 @@ function configureEndpoint(service) {
6464

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

7073
// merge config
71-
applyConfig(service, config);
74+
applyConfig(service, Object.assign(
75+
{},
76+
config,
77+
{ signatureVersion: (service.api && service.api.signatureVersion) || 'v4' }
78+
));
7279
return;
7380
}
7481
}

0 commit comments

Comments
 (0)