F64116045 commented on code in PR #11387:
URL: https://github.com/apache/ozone/pull/11387#discussion_r4711109605


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/EndpointBase.java:
##########
@@ -489,6 +492,29 @@ protected Map<String, String> getCustomMetadataFromHeaders(
     return customMetadata;
   }
 
+  private static String decodeRfc2047MetadataValue(String value) {
+    try {
+      return MimeUtility.decodeText(value);
+    } catch (UnsupportedEncodingException ex) {
+      return value;
+    }
+  }
+
+  private static String encodeRfc2047MetadataValue(String value) {
+    if (value.chars().allMatch(EndpointBase::isSafeAsciiMetadataCharacter)) {

Review Comment:
   thanks. yes the CR/LF was coming back as spaces
   
   >  Force the encoding when this check fails?
   
   I think we shouldn’t force-encode it because [S3 omits metadata containing 
unprintable 
characters](https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingMetadata.html).
 Instead, GET & HEAD now omit that header and set x-amz-missing-meta. I  also 
added a test for both.



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