From 37a7f3b16507fa69e4fb8eb5614ca01c7341f47c Mon Sep 17 00:00:00 2001 From: Dengke Date: Wed, 26 Feb 2025 09:47:29 -0800 Subject: [PATCH] fix the signing config --- s3transfer/crt.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/s3transfer/crt.py b/s3transfer/crt.py index 37b041d8..aaaf86e1 100644 --- a/s3transfer/crt.py +++ b/s3transfer/crt.py @@ -895,14 +895,22 @@ def _default_get_make_request_args( ) and accesspoint_arn_details['region'] == "": # Configure our region to `*` to propogate in `x-amz-region-set` # for multi-region support in MRAP accesspoints. + # use_double_uri_encode and should_normalize_uri_path are defaulted to be True + # But SDK already encoded the URI, and it's for S3, so set both to False make_request_args['signing_config'] = AwsSigningConfig( algorithm=AwsSigningAlgorithm.V4_ASYMMETRIC, region="*", + use_double_uri_encode=False, + should_normalize_uri_path=False ) call_args.bucket = accesspoint_arn_details['resource_name'] elif is_s3express_bucket(call_args.bucket): + # use_double_uri_encode and should_normalize_uri_path are defaulted to be True + # But SDK already encoded the URI, and it's for S3, so set both to False make_request_args['signing_config'] = AwsSigningConfig( - algorithm=AwsSigningAlgorithm.V4_S3EXPRESS + algorithm=AwsSigningAlgorithm.V4_S3EXPRESS, + use_double_uri_encode=False, + should_normalize_uri_path=False ) return make_request_args