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

CBG-3882 add Content-Length header #6767

Merged
merged 2 commits into from
Apr 10, 2024
Merged

CBG-3882 add Content-Length header #6767

merged 2 commits into from
Apr 10, 2024

Conversation

torcolvin
Copy link
Collaborator

Amazon S3 requires Content-Length header and doesn't support Transfer-Encoding: chunked

Python sets Transfer-Encoding: chunked if Content-Length is not set explicitly as per https://docs.python.org/3/library/urllib.request.html#urllib.request.Request

Aws s3 requires setting Content-Length according to https://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonRequestHeaders.html

I determined Content-Length using the same method for requests: https://github.com/psf/requests/blob/2a438c27b5a5828c8ea0dc958112eecffca70b12/src/requests/utils.py#L157

Amazon S3 requires Content-Length header and doesn't support
Transfer-Encoding: chunked
@torcolvin torcolvin enabled auto-merge (squash) April 10, 2024 21:50
@torcolvin torcolvin merged commit 4c29abc into main Apr 10, 2024
29 of 30 checks passed
@torcolvin torcolvin deleted the CBG-3882 branch April 10, 2024 22:05
torcolvin added a commit that referenced this pull request Apr 10, 2024
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.

2 participants