-
Notifications
You must be signed in to change notification settings - Fork 18k
mime: ParseMediaType rejects valid boundaries #26521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
RFC 2045 mentions:
according to RFC2045 special characters are only allowed within quoted-strings. RFC2046 even warns about this:
|
Thanks @FMNSSun. Closing as not-a-bug. |
Although it looks like there's not always quotes added in the multipart package:
So it might be that FormDataContentType returns invalid parameters according to RFC 2045? Might be worth re-opening (maybe another issue) and someone else have a look at this because I'm just a random person on the internet. |
https://play.golang.org/p/tC-Ri26iiTo
Looking at RFC 2046, parentheses are valid boundary characters:
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.
The text was updated successfully, but these errors were encountered: