fat-catTW commented on code in PR #12188:
URL: https://github.com/apache/ozone/pull/12188#discussion_r4816811648
##########
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();
Review Comment:
Thanks for the review!
Updated `fromHeaderValue` to return `OTHER` for null and removed the extra
null checks.
--
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]