aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/mime/multipart/multipart.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/mime/multipart/multipart.go')
-rw-r--r--libgo/go/mime/multipart/multipart.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/libgo/go/mime/multipart/multipart.go b/libgo/go/mime/multipart/multipart.go
index 77e969b..2c862a6 100644
--- a/libgo/go/mime/multipart/multipart.go
+++ b/libgo/go/mime/multipart/multipart.go
@@ -28,7 +28,12 @@ var emptyParams = make(map[string]string)
type Part struct {
// The headers of the body, if any, with the keys canonicalized
// in the same fashion that the Go http.Request headers are.
- // i.e. "foo-bar" changes case to "Foo-Bar"
+ // For example, "foo-bar" changes case to "Foo-Bar"
+ //
+ // As a special case, if the "Content-Transfer-Encoding" header
+ // has a value of "quoted-printable", that header is instead
+ // hidden from this map and the body is transparently decoded
+ // during Read calls.
Header textproto.MIMEHeader
buffer *bytes.Buffer
@@ -265,11 +270,10 @@ func (r *Reader) NextPart() (*Part, error) {
return nil, fmt.Errorf("multipart: unexpected line in Next(): %q", line)
}
- panic("unreachable")
}
// isFinalBoundary returns whether line is the final boundary line
-// indiciating that all parts are over.
+// indicating that all parts are over.
// It matches `^--boundary--[ \t]*(\r\n)?$`
func (mr *Reader) isFinalBoundary(line []byte) bool {
if !bytes.HasPrefix(line, mr.dashBoundaryDash) {