Skip to content

Commit

Permalink
Condense conditional; Update private function warning to docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan343 committed Oct 29, 2024
1 parent 75db0fe commit 009ea3d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
12 changes: 7 additions & 5 deletions botocore/httpchecksum.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,14 @@ def resolve_request_checksum_algorithm(
return

location_type = "header"
if operation_model.has_streaming_input:
if (
operation_model.has_streaming_input
and urlparse(request["url"]).scheme == "https"
):
# Operations with streaming input must support trailers.
if urlparse(request["url"]).scheme == "https":
# We only support unsigned trailer checksums currently. As this
# disables payload signing we'll only use trailers over TLS.
location_type = "trailer"
# We only support unsigned trailer checksums currently. As this
# disables payload signing we'll only use trailers over TLS.
location_type = "trailer"

algorithm = {
"algorithm": algorithm_name,
Expand Down
8 changes: 6 additions & 2 deletions botocore/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3255,9 +3255,13 @@ def _is_s3express_request(params):
return endpoint_properties.get('backend') == 'S3Express'


# This is not a public interface and is subject to abrupt breaking changes.
# Any usage is not advised or supported in external code bases.
def has_checksum_header(params):
"""
Checks if a header starting with "x-amz-checksum-" is provided in a request.
This class is considered private and subject to abrupt breaking changes or
removal without prior announcement. Please do not use it directly.
"""
headers = params['headers']

# If a header matching the x-amz-checksum-* pattern is present, we
Expand Down

0 comments on commit 009ea3d

Please sign in to comment.