#6276 Improve message parsing for signed message - #6277
Conversation
|
Hi @sosnovsky - This one is ready for a review. Thanks! |
sosnovsky
left a comment
There was a problem hiding this comment.
works well, just a couple minor improvements 👍
| if (!Mime.isSignedContentNode(current)) { | ||
| return currentSubject || fallbackSubject; | ||
| } | ||
| fallbackSubject = currentSubject; |
There was a problem hiding this comment.
I think it'll be better to use fallbackSubject = currentSubject || fallbackSubject for cases when currentSubject is undefined, so we can use previous non-null value.
| /* eslint-enable no-underscore-dangle */ | ||
| } | ||
| /* eslint-enable no-underscore-dangle */ | ||
| return undefined; |
There was a problem hiding this comment.
also here we should return fallbackSubject instead of undefined, for cases when in nested nodes some deep node is undefined, but there was some non-null node in previous nodes
| type SendingType = 'to' | 'cc' | 'bcc'; | ||
|
|
||
| export class Mime { | ||
| private static readonly MAX_SIGNED_CONTENT_DEPTH = 50; |
There was a problem hiding this comment.
there is similar recursive call in
which can cause extension lag for nested signed content. we'll need to implement similar fix there, but let's leave it for separate PR
This PR improve message parsing for signed message and prevents recursive parsing.
close #6276
Tests (delete all except exactly one):
To be filled by reviewers
I have reviewed that this PR... (tick whichever items you personally focused on during this review):