diff --git a/botocore/httpchecksum.py b/botocore/httpchecksum.py index 27bea8e248..1dce170e90 100644 --- a/botocore/httpchecksum.py +++ b/botocore/httpchecksum.py @@ -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, diff --git a/botocore/utils.py b/botocore/utils.py index 73a7e22605..34e1cc4e82 100644 --- a/botocore/utils.py +++ b/botocore/utils.py @@ -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