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

Add handling for blank lines in continued header fields #12

Closed
wants to merge 1 commit into from
Closed

Add handling for blank lines in continued header fields #12

wants to merge 1 commit into from

Conversation

ts2909
Copy link
Contributor

@ts2909 ts2909 commented Dec 8, 2016

Current handling of continued header fields would terminate if the field had a blank line, ie

Subject: Line 1
 Line 2
 
 Line 4
From: test@example.com

This is the body

The root part would end up containing:

Line 4
From: test@example.com

This is the body

Added handling for this and some expanded tests.

@coveralls
Copy link

coveralls commented Dec 8, 2016

Coverage Status

Coverage decreased (-0.007%) to 81.282% when pulling e459679 on ts2909:topic/headerContinuation into 2856163 on jhillyerd:develop.

@jhillyerd
Copy link
Owner

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()
// }
Copy link
Owner

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
Copy link
Owner

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"
*/
Copy link
Owner

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?

@jhillyerd
Copy link
Owner

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.

@jhillyerd
Copy link
Owner

Manually merged w/ fixups.

@jhillyerd jhillyerd closed this Dec 18, 2016
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.

None yet

3 participants