fat-catTW commented on code in PR #12188:
URL: https://github.com/apache/ozone/pull/12188#discussion_r4816812438


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java:
##########
@@ -248,17 +248,19 @@ Response handlePutRequest(ObjectRequestContext context, 
String keyPath, InputStr
       String amzDecodedLength =
           getHeaders().getHeaderString(S3Consts.DECODED_CONTENT_LENGTH_HEADER);
       String amzContentSha256 = 
getHeaders().getHeaderString(S3Consts.X_AMZ_CONTENT_SHA256);
-      boolean useDecodedLength = amzDecodedLength != null && amzContentSha256 
!= null &&
-          S3ContentSha256Type.fromHeaderValue(amzContentSha256).isStreaming();
+      S3ContentSha256Type payloadType = amzContentSha256 == null ? null :
+          S3ContentSha256Type.fromHeaderValue(amzContentSha256);
+      boolean useDecodedLength = amzDecodedLength != null && payloadType != 
null && payloadType.isStreaming();
       boolean isEmptyPayload = useDecodedLength ? 
Long.parseLong(amzDecodedLength) == 0 : length == 0;
       if (canCreateDirectory &&
           isEmptyPayload &&
           StringUtils.endsWith(keyPath, "/")
       ) {
         context.setAction(S3GAction.CREATE_DIRECTORY);
         if (STREAMING_UNSIGNED_PAYLOAD_TRAILER.equals(amzContentSha256)
-            || 
STREAMING_AWS4_HMAC_SHA256_PAYLOAD_TRAILER.equals(amzContentSha256)) {
-          // No key is opened for a directory: verify trailer framing and 
checksum without a chunk signing key.
+            || 
STREAMING_AWS4_HMAC_SHA256_PAYLOAD_TRAILER.equals(amzContentSha256)
+            || (payloadType != null && payloadType.isEcdsaSignedStreaming())) {

Review Comment:
   Addressed!



-- 
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]

Reply via email to