andyhuangdev opened a new pull request, #11562: URL: https://github.com/apache/ozone/pull/11562
## What changes were proposed in this pull request? S3 Gateway currently reads and writes the request body before rejecting a malformed x-amz-content-sha256 value with XAmzContentSHA256Mismatch. Such values cannot match a valid SHA-256 digest, so processing the body wastes I/O and network bandwidth. This patch adds format validation to the shared header validation method. Hash values that are not exactly 64 hexadecimal characters are rejected with InvalidArgument before the body is read or a write stream is opened. Existing unsigned and streaming payload handling remains unchanged. Well-formed hashes that do not match the body continue to return XAmzContentSHA256Mismatch. Existing test fixtures using malformed placeholder hashes are updated to use well-formed values so those tests continue exercising their intended behavior. ## What is the link to the Apache JIRA [HDDS-17055](https://issues.apache.org/jira/browse/HDDS-17055) ## How was this patch tested? - Confirmed that eight new regression cases failed before the fix. - Added header validation tests and tests confirming that malformed headers are rejected without reading the body for regular, datastream, and multipart uploads. - Verified successful uploads with matching hashes and existing mismatch behavior. - Ran 674 tests covering the new behavior and affected test classes; all passed. - Ran the project checkstyle script and git diff --check; both passed. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
