Skip to content

Commit df53fce

Browse files
authored
Readd handling for conditional-md5 (#3390)
1 parent d7df9ed commit df53fce

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

botocore/httpchecksum.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@
3333
)
3434
from botocore.model import StructureShape
3535
from botocore.response import StreamingBody
36-
from botocore.utils import determine_content_length, has_checksum_header
36+
from botocore.utils import (
37+
conditionally_calculate_md5,
38+
determine_content_length,
39+
has_checksum_header,
40+
)
3741

3842
if HAS_CRT:
3943
from awscrt import checksums as crt_checksums
@@ -354,7 +358,10 @@ def apply_request_checksum(request):
354358
if not algorithm:
355359
return
356360

357-
if algorithm["in"] == "header":
361+
if algorithm == "conditional-md5":
362+
# Special case to handle the http checksum required trait
363+
conditionally_calculate_md5(request)
364+
elif algorithm["in"] == "header":
358365
_apply_request_header_checksum(request)
359366
elif algorithm["in"] == "trailer":
360367
_apply_request_trailer_checksum(request)

0 commit comments

Comments
 (0)