Skip to content
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 whitespace in stream decoder #2

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

nahne
Copy link
Contributor

@nahne nahne commented Nov 22, 2024

How does this PR improve libqp?

Without this PR, when decoding a quoted-printable stream, some spaces will get silently dropped, depending on stream chunk boundaries. With this PR, spaces and tabs are preserved as specified in RFC2045.

Steps to reproduce the issue

Run the tests in this PR. Without this PR, 3 tests will fail:

Expected behavior

The decoded data should not change when the encoded data is provided in multiple stream chunks.

Actual behavior

Spaces and tabs are discarded, even though they should be preserved per RFC2045.

Related issues

We discovered the behavior when using nodemailer to parse quoted-printable encoded PDF attachments.

nodemailer #379: quoted-printable attachment missing some tabs might be related

Copy link

@ornotnull ornotnull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my RE was simplier
/[\t ]*\=[^\n]?$/

possible it does not cover the all cases
this test failed:
not ok 4 - stream, space at end of chunk

@andris9
Copy link
Member

andris9 commented Nov 23, 2024

Thank you. Will check this next week once I’m back from my vacation

@andris9 andris9 merged commit 1ed3f83 into nodemailer:master Nov 29, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants