-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
Description
contentType := "multipart/alternative; boundary=(boundary)"
_, _, err := mime.ParseMediaType(contentType)
// err = mime: invalid media parameter
https://play.golang.org/p/tC-Ri26iiTo
Looking at RFC 2046, parentheses are valid boundary characters:
boundary := 0*69<bchars> bcharsnospace
bchars := bcharsnospace / " "
bcharsnospace := DIGIT / ALPHA / "'" / "(" / ")" /
"+" / "_" / "," / "-" / "." /
"/" / ":" / "=" / "?"
https://tools.ietf.org/html/rfc2046#section-5.1.1:
Indeed, the SetBoundary function in the multipart package checks the boundary is valid, and explicitly lets '(' and ')' pass through.
If someone else double-checks my work and confirms this is a bug, I'm happy to fix it.
Reactions are currently unavailable