]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1] mime/multipart: report io.EOF correctly on part ending without...
authorBrad Fitzpatrick <bradfitz@golang.org>
Tue, 24 Apr 2012 05:26:48 +0000 (22:26 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 24 Apr 2012 05:26:48 +0000 (22:26 -0700)
commitb4ea696b49427919bbae6d24bedecb2750567da0
tree0b978b97be51372184fc90f5f9b9fe7c2c9912ce
parentc619931610c53441685a34babe391073002c2e42
[release-branch.go1] mime/multipart: report io.EOF correctly on part ending without newlines

««« backport 4ecca118488b
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
»»»
src/pkg/mime/multipart/multipart.go
src/pkg/mime/multipart/multipart_test.go
src/pkg/mime/multipart/testdata/nested-mime [new file with mode: 0755]