-
Notifications
You must be signed in to change notification settings - Fork 100
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
Add handling for blank lines in continued header fields #12
Conversation
Thanks for the PRs, you are on a roll. 🎱 My home internet has been offline a couple days, I'll try and dig into these once I get back online. |
@@ -72,52 +72,57 @@ func debug(format string, args ...interface{}) { | |||
// readHeader reads a block of SMTP or MIME headers and returns a textproto.MIMEHeader. | |||
// Header parse warnings & errors will be added to p.Errors, io errors will be returned directly. | |||
func readHeader(r *bufio.Reader, p *Part) (textproto.MIMEHeader, error) { | |||
// if true { | |||
// return textproto.NewReader(r).ReadMIMEHeader() | |||
// } |
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.
Can you remove this?
data[i] = 'x' | ||
} | ||
sdata := string(data) | ||
_ = sdata |
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.
I think the _ assignment can be removed, sdata is referenced below
"SID : 0\r\n" + | ||
"Audio Mode : None\r\n" + | ||
"Privilege : 127\r\n\r\n" | ||
*/ |
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.
This looks like it was a temporary comment, can it be removed?
Let me know if you'd rather I make the changes myself - I'm not sure how much time you want to put into it. But I fear if I make the changes and squash the commit, you will not get credit in the commit log. |
Manually merged w/ fixups. |
Current handling of continued header fields would terminate if the field had a blank line, ie
The root part would end up containing:
Added handling for this and some expanded tests.