Skip to content

Commit d832634

Browse files
committed
Lowercase the region for signing
The SigV4 signing mechanism uses a lowercase region when constructing the string to sign. This change ensures that we always use the lowercase region in our own construction.
1 parent 4d6efea commit d832634

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/main/java/software/aws/mcs/auth/SigV4AuthProvider.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,9 @@ public SigV4AuthProvider(@NotNull AwsCredentialsProvider credentialsProvider, fi
156156
if (region == null) {
157157
DefaultAwsRegionProviderChain chain = new DefaultAwsRegionProviderChain();
158158
Region defaultRegion = chain.getRegion();
159-
this.signingRegion = defaultRegion.toString();
160-
159+
this.signingRegion = defaultRegion.toString().toLowerCase();
161160
} else {
162-
this.signingRegion = region;
161+
this.signingRegion = region.toLowerCase();
163162
}
164163

165164
if (this.signingRegion == null) {

0 commit comments

Comments
 (0)