fix(s3): set content length for copy object#7884
Conversation
|
Just for my own curiosity, is there any doc mentioning netapp S3 gateway requires content-length header? I didn't find it after some seach |
|
|
||
| fn build(self) -> Result<impl Service> { | ||
| impl S3Builder { | ||
| fn build_backend(self) -> Result<S3Backend> { |
There was a problem hiding this comment.
I needed to test the constructor in a UT, but the construction was not separate, it was happening inside impl Builder, which returned Service, not S3Backend.
Doing this allowed me to test on S3Backend itself w/o duplicating much code.
@dentiny even I couldn't find one that explicitly makes it mandatory. However, I did find their error listing which has one |
Which issue does this PR close?
Closes #7821.
Rationale for this change
Some S3-compatible services require
Content-Lengthto be present onCopyObjectrequests, even when the request body is empty. OpenDAL already sends an empty body for S3 copy, so this makes the request explicit by settingContent-Length: 0.What changes are included in this PR?
Content-Length: 0when building S3CopyObjectrequests.s3_copy_object_request, matching existing request-builder patterns.Are there any user-facing changes?
No API changes. This improves compatibility with S3-compatible services.
AI Usage Statement
I used OpenAI Codex to help implement and test this change.