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

Inserting headers at top causes change in header order #524

Closed
nitinag opened this issue Nov 19, 2019 · 2 comments
Closed

Inserting headers at top causes change in header order #524

nitinag opened this issue Nov 19, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@nitinag
Copy link

nitinag commented Nov 19, 2019

When trying to insert a header on the top of the header list, the Content-* Body headers are moved to the top:

var sourceStream = new MemoryStream(Encoding.UTF8.GetBytes(@"From: Example Test <[email protected]>
MIME-Version: 1.0
Content-Type: multipart/mixed;
   boundary=""simple boundary""

Test
"));

var mimeMessage = MimeMessage.Load(sourceStream);
mimeMessage.Headers.Insert(0, HeaderId.Received, "Test");

The resulting output is:

Content-Type: multipart/mixed;
   boundary="simple boundary"
Received: Test
From: Example Test <[email protected]>
MIME-Version: 1.0

Test

Expected behavior
MimeKit should maintain header order and add the header to the top.

@jstedfast jstedfast added the bug Something isn't working label Nov 19, 2019
@jstedfast
Copy link
Owner

I've got a fix for this locally, but I want to verify with some unit tests first.

This week is back-to-back meetings, so I'm finding it difficult to make time to write code this week.

@nitinag
Copy link
Author

nitinag commented Nov 20, 2019

No worries, thanks for the work addressing it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants