-
Notifications
You must be signed in to change notification settings - Fork 18k
mime: allow duplicate media parameters with equal values #48866
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
This proposal has been added to the active column of the proposals project |
Unfortunately the email doesn't contain a header like
|
It sounds like the proposal is to continue to reject duplicate boundary= parameters but have a special case that if the duplicates all say the same boundary value, then it's OK. There's at least one buggy program generating these, and the intent is at least pretty clear. Do I have that right? |
You're right. Unlike duplicate parameters with different values, there's no need to judge which one to use as final value, so ideally it should be allowed. :) Note: ideally it should apply to all duplicate parameters with same value, not just |
Based on the discussion above, this proposal seems like a likely accept. |
No change in consensus, so accepted. 🎉 |
I'll take a stab and open a CL for this if it's okay. With a quick look through the RFC, it seems like the the tokens are case-insensitive, but I'm not sure if this is okay for edge-case tokens using different character sets. |
Change https://golang.org/cl/363094 mentions this issue: |
Dear @tpaschalis @rsc Thank you very much. :) |
Wait, we shouldn't close this issue yet. This now tracks actually implementing the change. |
Change https://go.dev/cl/450280 mentions this issue: |
For #48866 For #54139 For #54801 Change-Id: Iafe72ccc7e756ec1edb5bb7e8e90d385458cff29 Reviewed-on: https://go-review.googlesource.com/c/go/+/450280 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
[This is a duplicate proposal of #28618, but it's closed due to
Timed out in state WaitingForInfo.
and doesn't accept further discussion.]Some mail user agent (MUA) (incorrectly) generates mail header with duplicate parameter names, this is the one i received recently (duplicate
boundary
):Golang standard library
mime.ParseMediaType()
does not allow duplicate media parameters so it is impossible to parse such a header (it returns errormime: duplicate parameter name
).I suggest making the
mime.ParseMediaType()
function more tolerant to such errors, for example, just use the first value and ignore the rest. At least it should not stop the execution if duplicate parameters have the same value.See also:
Content-Type: text/html; charset=utf-8; charset=UTF-8
Content-Type: multipart/form-data;boundary="boundary";boundary="another-boundary"
The text was updated successfully, but these errors were encountered: