Fix binary attachment and Content-Disposition header handling#8
Open
jacekkow wants to merge 2 commits into
Open
Fix binary attachment and Content-Disposition header handling#8jacekkow wants to merge 2 commits into
jacekkow wants to merge 2 commits into
Conversation
Binary files do not like to have 0x0D 0x0A replaced with 0x0A
Per RFC6266: > If the disposition type matches "attachment" (case-insensitively) (...) > The parameters "filename" and "filename*", to be matched case-insensitively (...)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While trying to use this library I have noticed two problems:
Some binary attachments in S/MIME signed e-mail were not rejected by ASN.1 parser. It turns out that the
0x0D 0x0Abyte sequence is unconditionally replaced by0x0A. Solution: do not touch attachments, return their content as-is.Content-Dispositionheader is case-sensitive, even though relevant documentation states it must be case-insensitive. Solution: case fold value before comparison and addiflag to regexps.