]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1] mime/multipart: fix handling of empty parts without CRLF before...
authorBrad Fitzpatrick <bradfitz@golang.org>
Wed, 13 Jun 2012 20:23:52 +0000 (16:23 -0400)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 13 Jun 2012 20:23:52 +0000 (16:23 -0400)
commitbd0227bbec8edcf976f0dc68b93c4ea9557b7287
tree8e1c3a607ae594c2723e204947cd4c30d33e33c7
parentff5f88f214c1cd7494d64f1435ba860a302d1446
[release-branch.go1] mime/multipart: fix handling of empty parts without CRLF before next part

««« backport 32a8b0e41031
mime/multipart: fix handling of empty parts without CRLF before next part

Empty parts can be either of the form:

a) "--separator\r\n", header (w/ trailing 2xCRLF), \r\n "--separator"...
or
b) "--separator\r\n", header (w/ trailing 2xCRLF), "--separator"...

We never handled case b).  In fact the RFC seems kinda vague about
it, but browsers seem to do a), and App Engine's synthetic POST
bodies after blob uploads is of form b).

So handle them both, and add a bunch of tests.

(I can't promise these are the last fixes to multipart, especially
considering its history, but I'm growing increasingly confident at
least, and I've never submitted a multipart CL with known bugs
outstanding, including this time.)

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6212046

»»»
src/pkg/mime/multipart/multipart.go
src/pkg/mime/multipart/multipart_test.go