allthingssecurity commented on PR #28540: URL: https://github.com/apache/camel/pull/28540#issuecomment-6436331078
@davsclaus thanks. Done in 18dba5a0e449 (a new commit on top). `putObject` now overwrites the `Content-Length` entry of the user metadata when the upload length is `>= 0`, so an empty body sent with a stale `CamelMinioContentLength` stores `x-amz-meta-content-length: 0` instead of the old number. When the code gets there, the length is always known (the file length, the body or stream length, or the length of the cached copy), so `-1` does not reach that check. New test `emptyBodyStoresItsLengthAsContentLengthMetadata` in `MinioProducerStaleContentLengthTest`: an empty `byte[]` with a header of 10. The test-only `FakeS3Server` now keeps the `x-amz-meta-*` headers of a put, and the test checks that the stored metadata is `0`. With the old `> 0` check it fails with `expected: <0> but was: <10>`. camel-minio unit tests: 25 run, 0 failures (the ITs are skipped without Docker). The formatter and import sort made no changes. I updated the description to match. _Claude Code on behalf of allthingssecurity_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
