-
Notifications
You must be signed in to change notification settings - Fork 7k
fix: Use mime encode for Non-US-ASCII metadata #21282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Use mime encode for Non-US-ASCII metadata #21282
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the encoding of Non-US-ASCII metadata by applying MIME encoding with conditional use of either B-encoding or Q-encoding based on the encoded length.
- Added MIME and Base64 package imports for encoding
- Updated metadata headers in setObjectHeaders with heuristic-based encoding
- Introduced the helper function needsMimeEncoding to determine when encoding is required
|
It seems like "How to test this PR?" just causes a regression the way you present it. Does AWS S3 do the same? Is there a bug in mc? |
This comment was marked as off-topic.
This comment was marked as off-topic.
fix: Use mime encode for Non-US-ASCII metadata
e71c5e4 to
67d6f5e
Compare
bug in AWS S3 @klauspost |
|
It looks like @jiuker didn't add the comment that there is a bug in AWS S3, we should write that here in this code path. |
|
Add tests with samples referenced against AWS, so sending [xyz...] in the header should produce the same response [qwe...] as AWS. If you do that on the Server we are fine. Also fix up minio-go, so it is round-trip safe. That means you get back what you send. If you did the server correctly, that should work against both AWS and MinIO servers. |
@klauspost AWS returns wrong characters - here is missing comment from the PR that I had asked @jiuker to add. |
Added |
|
@harshavardhana Yes. I saw your comment and asked for clarification since only half of it makes sense. This should still have tests, either here or in mint. |
Will have test for mint. @klauspost |
shtripat
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
fix: Use mime encode for Non-US-ASCII metadata
Community Contribution License
All community contributions in this pull request are licensed to the project maintainers
under the terms of the Apache 2 license.
By creating this pull request I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 license.
Description
fix #21256
Motivation and Context
How to test this PR?
Show
X-Amz-Meta-Minio: MiniöbeforeTypes of changes
Checklist:
commit-idorPR #here)