Skip to content

Commit d77d255

Browse files
Copy the ClientConfiguration to avoid modifying the original
1 parent 2e679b2 commit d77d255

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main/java/com/amazonaws/encryptionsdk/kms/KmsMasterKeyProvider.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ public KmsMasterKeyProvider(final AWSCredentialsProvider creds) {
114114
public KmsMasterKeyProvider(final AWSCredentialsProvider creds, final Region region,
115115
final ClientConfiguration clientConfiguration, final String keyId) {
116116
this(
117-
new AWSKMSClient(creds, clientConfiguration.withUserAgentSuffix(VersionInfo.USER_AGENT)),
117+
new AWSKMSClient(
118+
creds,
119+
new ClientConfiguration(clientConfiguration).withUserAgentSuffix(VersionInfo.USER_AGENT)),
118120
region,
119121
Collections.singletonList(keyId));
120122
}
@@ -126,7 +128,9 @@ public KmsMasterKeyProvider(final AWSCredentialsProvider creds, final Region reg
126128
public KmsMasterKeyProvider(final AWSCredentialsProvider creds, final Region region,
127129
final ClientConfiguration clientConfiguration, final List<String> keyIds) {
128130
this(
129-
new AWSKMSClient(creds, clientConfiguration.withUserAgentSuffix(VersionInfo.USER_AGENT)),
131+
new AWSKMSClient(
132+
creds,
133+
new ClientConfiguration(clientConfiguration).withUserAgentSuffix(VersionInfo.USER_AGENT)),
130134
region,
131135
keyIds);
132136
}

0 commit comments

Comments
 (0)