F64116045 opened a new pull request, #11387:
URL: https://github.com/apache/ozone/pull/11387

   ## What changes were proposed in this pull request?
   
   The ceph/s3-tests `test_object_set_get_unicode_metadata` exposed that S3 
Gateway does not handle non-ASCII user metadata correctly.
   
   Investigation showed that S3 uses RFC 2047 for non-ASCII `x-amz-meta-*` 
values. Ozone currently stores encoded values as ordinary text and does not 
encode them when returning response headers.
   
   This patch decodes RFC 2047 Q/B values before storing metadata and encodes 
non-ASCII values in GET and HEAD responses. 
   
   References:
   
   - [ceph/s3-tests failure 
case](https://github.com/ceph/s3-tests/blob/fb8b73092bb1dd8db829f1205a9e52e73bf9a232/s3tests/functional/test_s3.py#L1883-L1899)
   - [Amazon S3 metadata 
behavior](https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingMetadata.html#UserMetadata)
   
   Note:
   I kept this PR to the single encoded-word case so we can agree on the basic 
read&write behavior first. 
   Multiple words and long values need more work. If this direction looks good, 
I’ll take those on in a follow-up.
   
   ## What is the link to the Apache JIRA?
   
   https://issues.apache.org/jira/browse/HDDS-16672
   
   ## How was this patch tested?
   
   CI: https://github.com/F64116045/ozone/actions/runs/37118609154
   
   Uploaded an object with this RFC 2047 encoded `café` metadata:
   
   `x-amz-meta-meta1: =?UTF-8?B?Y2Fmw6k=?=`
   
   The same request was tested against Ozone before and after this patch, and 
against S3. 
   
   B and Q are two RFC 2047 representations of the same `café` value.
   
   | | Ozone before | Ozone after | S3 |
   | --- | --- | --- | --- |
   | Stored value | Encoded header text | `café` | Not observable |
   | HEAD response | B-encoded `café` | Q-encoded `café` | Q-encoded `café` |


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