1
0
mirror of https://github.com/golang/go synced 2024-10-04 14:21:21 -06:00
go/src/pkg/mime/multipart
Brad Fitzpatrick 87eaa4cd0c mime/multipart: report io.EOF correctly on part ending without newlines
If a part ends with "--boundary--", without a final "\r\n",
that's also a graceful EOF, and we should return io.EOF instead
of the fmt-wrapped io.EOF from bufio.Reader.ReadSlice.

I found this bug parsing an image attachment from gmail.
Minimal test case stripped down from the original
gmail-generated attachment included.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6118043
2012-04-23 22:26:48 -07:00
..
testdata mime/multipart: report io.EOF correctly on part ending without newlines 2012-04-23 22:26:48 -07:00
formdata_test.go mime/multipart: allow for temp files to be removed after tests are finished on Windows 2011-06-11 16:23:44 +10:00
formdata.go bytes,strings: make *Reader implement io.ReaderAt 2012-02-15 12:58:00 +11:00
multipart_test.go mime/multipart: report io.EOF correctly on part ending without newlines 2012-04-23 22:26:48 -07:00
multipart.go mime/multipart: report io.EOF correctly on part ending without newlines 2012-04-23 22:26:48 -07:00
writer_test.go mime/multipart: remove newline at top of the multipart. 2011-06-23 10:11:33 -07:00
writer.go src/pkg/[a-m]*: gofix -r error -force=error 2011-11-01 22:04:37 -04:00