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

mime/multipart: leading whitespace is trimmed #5295

Closed
eaigner opened this issue Apr 16, 2013 · 5 comments
Closed

mime/multipart: leading whitespace is trimmed #5295

eaigner opened this issue Apr 16, 2013 · 5 comments
Milestone

Comments

@eaigner
Copy link
Contributor

eaigner commented Apr 16, 2013

RFC 2045 states, that whitespace should only be trimmed at the end of a line, yet the
following example shows that leading whitespace was removed (although it would not
matter to the output in that specific example).

In the source on line 54, there is a space before the closing "/>", in the
output there is not.

"charset=utf-8"/>" should be "charset=utf-8" />"

Attachments:

  1. mtest.go (1415 bytes)
@eaigner
Copy link
Contributor Author

eaigner commented Apr 16, 2013

Comment 1:

It also occurs when you insert it in the text part above
```
This is the text=0A part=
 Newline
```
converting to
```
This is the text
 partNewline
```

@bradfitz
Copy link
Contributor

Comment 2:

I haven't looked into this yet, but in any case it's too late for Go 1.1.
In our previous debugging we've found that no two MIME and/or quoted-printable
implementations tend to do the same thing.
If we're in violation of the RFC and also other popular implementations, we should fix
this.  But I haven't read the specs or looked at your examples yet.

Labels changed: added packagebug, removed priority-triage.

Status changed to Accepted.

@eaigner
Copy link
Contributor Author

eaigner commented Apr 17, 2013

Comment 3:

I've found that ALL other implementations I've seen preserve leading whitespace, except
Go. This is critical, and should be fixed, otherwise the whole package is useless for
live apps.
In my case, all EML envelopes would be parsed incorrectly.

@bradfitz
Copy link
Contributor

Comment 4:

Fix out for review: https://golang.org/cl/8536045
This would normally be too late given the Go 1.1 freeze (http://golang.org/s/go11freeze)
but I would argue this is a pretty bad regression from Go 1.0.

Labels changed: added go1.1.

Status changed to Started.

@mikioh
Copy link
Contributor

mikioh commented Apr 20, 2013

Comment 5:

This issue was closed by revision 24555c7.

Status changed to Fixed.

@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants