Skip to content

Commit

Permalink
make the behavior more clear from the Python code instead of buried b…
Browse files Browse the repository at this point in the history
…ehind the C implementation
  • Loading branch information
TingDaoK committed Sep 3, 2024
1 parent bbd449a commit f1e047d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions botocore/crt/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,8 @@ def _apply_signing_changes(self, aws_request, signed_crt_request):
aws_request.url = urlunsplit((p[0], p[1], p[2], signed_query, p[4]))

def _should_add_content_sha256_header(self, existing_sha256, explicit_payload):
# only add X-Amz-Content-SHA256 header if header already exists.
return existing_sha256 is not None
# only add X-Amz-Content-SHA256 header if header already set to UNSIGNED_PAYLOAD
return existing_sha256 == UNSIGNED_PAYLOAD


class CrtS3SigV4AsymQueryAuth(CrtSigV4AsymQueryAuth):
Expand Down Expand Up @@ -596,8 +596,8 @@ def _apply_signing_changes(self, aws_request, signed_crt_request):
aws_request.url = urlunsplit((p[0], p[1], p[2], signed_query, p[4]))

def _should_add_content_sha256_header(self, existing_sha256, explicit_payload):
# only add X-Amz-Content-SHA256 header if header already exists.
return existing_sha256 is not None
# only add X-Amz-Content-SHA256 header if header already set to UNSIGNED_PAYLOAD
return existing_sha256 == UNSIGNED_PAYLOAD


class CrtS3SigV4QueryAuth(CrtSigV4QueryAuth):
Expand Down

0 comments on commit f1e047d

Please sign in to comment.