File tree Expand file tree Collapse file tree 3 files changed +151
-105
lines changed
core/auth-crt/src/main/java/software/amazon/awssdk/authcrt/signer/internal
services/s3control/src/it/java/software.amazon.awssdk.services.s3control Expand file tree Collapse file tree 3 files changed +151
-105
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "type" : " bugfix" ,
3+ "category" : " AWS SDK for Java v2" ,
4+ "contributor" : " " ,
5+ "description" : " Do not instruct the CRT Sigv4a signer to do path normalization to avoid signature mismatch errors"
6+ }
Original file line number Diff line number Diff line change 3232public class SigningConfigProvider {
3333
3434 private static final Boolean DEFAULT_DOUBLE_URL_ENCODE = Boolean .TRUE ;
35+ private static final Boolean DEFAULT_PATH_NORMALIZATION = Boolean .TRUE ;
3536
3637 public SigningConfigProvider () {
3738 }
@@ -89,13 +90,20 @@ private AwsSigningConfig createPresigningConfig(ExecutionAttributes executionAtt
8990 private AwsSigningConfig createDefaultRequestConfig (ExecutionAttributes executionAttributes ) {
9091 AwsSigningConfig signingConfig = createStringToSignConfig (executionAttributes );
9192
92- signingConfig .setShouldNormalizeUriPath (true );
93+ if (executionAttributes .getAttribute (AwsSignerExecutionAttribute .SIGNER_NORMALIZE_PATH ) != null ) {
94+ signingConfig .setShouldNormalizeUriPath (
95+ executionAttributes .getAttribute (AwsSignerExecutionAttribute .SIGNER_NORMALIZE_PATH ));
96+ } else {
97+ signingConfig .setShouldNormalizeUriPath (DEFAULT_PATH_NORMALIZATION );
98+ }
99+
93100 if (executionAttributes .getAttribute (AwsSignerExecutionAttribute .SIGNER_DOUBLE_URL_ENCODE ) != null ) {
94- signingConfig .setUseDoubleUriEncode (executionAttributes
95- .getAttribute (AwsSignerExecutionAttribute .SIGNER_DOUBLE_URL_ENCODE ));
101+ signingConfig .setUseDoubleUriEncode (
102+ executionAttributes .getAttribute (AwsSignerExecutionAttribute .SIGNER_DOUBLE_URL_ENCODE ));
96103 } else {
97104 signingConfig .setUseDoubleUriEncode (DEFAULT_DOUBLE_URL_ENCODE );
98105 }
106+
99107 return signingConfig ;
100108 }
101109
You can’t perform that action at this time.
0 commit comments