[
https://issues.apache.org/jira/browse/HDDS-15032?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chu Cheng Li resolved HDDS-15032.
---------------------------------
Fix Version/s: 2.2.0
Target Version/s: 2.2.0
Resolution: Fixed
> Return InvalidDigest instead of BadDigest for malformed Content-MD5 header
> --------------------------------------------------------------------------
>
> Key: HDDS-15032
> URL: https://issues.apache.org/jira/browse/HDDS-15032
> Project: Apache Ozone
> Issue Type: Sub-task
> Reporter: Hsu Han Wen
> Assignee: Hsu Han Wen
> Priority: Major
> Labels: pull-request-available
> Fix For: 2.2.0
>
>
> This issue is a follow-up to the implementation of HDDS-10633, which
> introduced support for the {{Content-MD5}} header in S3Gateway.
> According to the [Amazon S3 Error
> Responses|https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html],
> there are two distinct error codes for {{Content-MD5}} validation that
> should be handled at different stages:
> # {*}InvalidDigest{*}: Triggered when the {{Content-MD5}} header is
> malformed (e.g., not Base64 encoded or incorrect length). This should be
> validated during the initial request parsing/header validation stage.
> # {*}BadDigest{*}: Triggered when the header is syntactically valid, but the
> MD5 checksum calculated by the server does not match the value provided in
> the header.
> Currently, our implementation primarily addresses {{BadDigest}} logic during
> data integrity checks but lacks explicit handling for malformed headers,
> which results in either a generic error or an incorrect error code being
> returned to the client.
> *Expected Behavior:* Requests with an syntactically invalid {{Content-MD5}}
> header should return *HTTP 400* with the error code {*}InvalidDigest{*}.
>
> Additional context:
> This issue was identified during S3 compatibility testing using:
> https://peterxcli.github.io/ozone-s3-compatibility/
> The following ceph s3-tests are currently failing:
> - test_object_create_bad_md5_invalid_short
> - test_object_create_bad_md5_empty
> These tests expect the service to return `InvalidDigest` for malformed
> `Content-MD5` headers, but the current implementation returns an incorrect or
> generic error response.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]