F64116045 commented on PR #11387:
URL: https://github.com/apache/ozone/pull/11387#issuecomment-6388208627

   @peterxcli Thanks for the question
   > should we use mature lib to do this or do you have any reference for your 
decodeRfc2047MetadataValue implementation?
   
   Actually we’re already using Ozone’s existing Commons Codec here for 
decoding and encoding.
   The extra check is there because decoding malformed values directly can 
silently change the metadata we store.
   (For example, `=?UTF-8?B?!!!?=` gets decoded to an empty string without an 
error.)
   Also FYI the check is based on the encoded-word syntax in [RFC 2047, 
Sections 2 and 4](https://www.rfc-editor.org/rfc/rfc2047)
   
   I also just looked into `MimeUtility`, and found it supports multiple 
encoded-words, which we were considering for a follow-up, so I think it’s worth 
using here. 
   That said, it can also partially decode malformed values, so we'd still need 
to check the input first, as we do now.
   Wonder what do you think?


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