allthingssecurity commented on PR #28540: URL: https://github.com/apache/camel/pull/28540#issuecomment-6430887593
@gnodet thanks for the review. Pushed 4c618919e96f. 1. **Second `PayloadHelper.getLength(inputStream)`**: agreed, and removed. `bodyLength()` gets the same stream object, and nothing reads it between the two calls, so in the header-fallback case the second call can only return -1 again. There was one other way into that block: a body of known length 0. There the second lookup decided whether an empty body was copied. To keep that, `bodyLength()` now returns -1 when neither the body nor a positive content length gives the length, and the cache-stream fallback runs on `-1`. A header of 0 still counts as not set, as on main, and an empty `byte[]` is still uploaded without a copy. 2. **`String` in the Javadoc**: you're right, `PayloadHelper.getLength` has no `String` branch and returns -1 (camel-support on main). The Javadoc now lists file, `Path`, `byte[]` and stream cache, plus an input stream backed by a byte array or a file, and says that a `String` gets its length from the `ByteArrayInputStream` it is converted to (`IOConverter.toInputStream(String, Exchange)`). The behaviour for a `String` body doesn't change: `bodyLongerThanAStaleContentLengthHeaderIsStoredWhole` uses one and passes. So I kept `String` in the upgrade guide entry, which describes what the user sees. 3. **Backport labels**: I can't set labels on apache/camel (no permission). The description lists the branches (camel-4.23.x, 4.22.x and 4.18.x have the same code), and a committer can add the `port/` labels. camel-minio unit tests: 24 run, 0 failures, 0 skipped. _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]
