You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Hsu Han Wen (Jira)" <ji...@apache.org> on 2026/04/14 03:05:00 UTC

[jira] [Created] (HDDS-15032) Return InvalidDigest instead of BadDigest for malformed Content-MD5 header

Hsu Han Wen created HDDS-15032:
----------------------------------

             Summary: 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


This issue is a follow-up to the implementation of [HDDS-10633|https://issues.apache.org/jira/browse/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{*}.
 *  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org