Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore Content-Length header when setting 'chunked' for Transfer-Encoding #9265

Merged
merged 2 commits into from
Jan 31, 2025

Conversation

jonathan343
Copy link
Contributor

@jonathan343 jonathan343 commented Jan 30, 2025

Note: This is the AWS CLI v2 version of boto/botocore#3360

This PR removes the Content-Length header when a request is sent using chunked upload.

See the guidance below from Signature Calculations for the Authorization Header: Transferring Payload in Multiple Chunks for more details

When transferring data in a series of chunks, you must do one of the following:

Explicitly specify the total content length (object length in bytes plus metadata in each chunk) using the Content-Length HTTP header. To do this, you must pre-compute the total length of the payload, including the metadata that you send in each chunk, before starting your request.

Specify the Transfer-Encoding HTTP header. If you include the Transfer-Encoding header and specify any value other than identity, you must omit the Content-Length header.

For all requests, you must include the x-amz-decoded-content-length header, specifying the size of the object in bytes.

Copy link
Member

@nateprewitt nateprewitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@jonathan343 jonathan343 merged commit 9f4bbe8 into aws:v2 Jan 31, 2025
38 of 45 checks passed
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (d413154) to head (7bf89c9).
Report is 11 commits behind head on v2.

Additional details and impacted files
@@    Coverage Diff     @@
##   v2   #9265   +/-   ##
==========================
==========================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants