-
Notifications
You must be signed in to change notification settings - Fork 117
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
textproto: Add Header.Count and HeaderFields.Set #75
Conversation
Codecov Report
@@ Coverage Diff @@
## master #75 +/- ##
==========================================
- Coverage 80.1% 79.96% -0.15%
==========================================
Files 15 15
Lines 995 1003 +8
==========================================
+ Hits 797 802 +5
- Misses 122 125 +3
Partials 76 76
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nack. This will break DKIM signatures and other things. Header fields should always be added at the top.
To set a field, one should remove the old field and add the new one at the top.
Indeed it will. But... We already have Del, we already have Header.Set. These are signature-breaking operations too. I don't think there is a problem implementing these if it is clearly documented that it will break signatures. You can see my use case in the referenced issue. What do I do? Also, I think milter client will also need to support such operations (and also index-based access). |
I still don't know how I feel about One important property ensured by I wonder if we should instead add a helper to create a |
Okay, I see. I also understand that my use case is rather specific, I need ability to preserve header structure as much as possible while being able to modify separate fields freely when needed. I guess, MutableHeader can exist in go-mesaage that provides all such operations (and that includes index-based operations, as they are needed for milter). In that case, Header can be a restricted wrapper for MutableHeader. Converting back and fourth between map of slices will destroy the structure and is simply inefficient. Or, since my case is rather specific. I might stop trying to bend your library for my needs if you want to keep it the way it is. |
So what are we doing here? FYI Milter protocol defines two (three) header operations:
|
Okay, milter protocol version 2 includes SMFI_INSHEADER, "insert header field at a specified index". |
Yeah. I'd suggest turning the |
Replaced by #94. |
No description provided.