mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
mime: parse media types that contain braces
This CL fixes a bug introduced by CL 666655: isTokenChar would no longer
(but should) report true for '{' and '}'.
Fixes #76236
This commit is contained in:
parent
a0eb4548cf
commit
c91a75c2c8
2 changed files with 5 additions and 0 deletions
|
|
@ -62,7 +62,9 @@ func isTokenChar(c byte) bool {
|
|||
1<<'^' |
|
||||
1<<'_' |
|
||||
1<<'`' |
|
||||
1<<'{' |
|
||||
1<<'|' |
|
||||
1<<'}' |
|
||||
1<<'~'
|
||||
return ((uint64(1)<<c)&(mask&(1<<64-1)) |
|
||||
(uint64(1)<<(c-64))&(mask>>64)) != 0
|
||||
|
|
|
|||
|
|
@ -413,6 +413,9 @@ func init() {
|
|||
// Issue #48866: duplicate parameters containing equal values should be allowed
|
||||
{`text; charset=utf-8; charset=utf-8; format=fixed`, "text", m("charset", "utf-8", "format", "fixed")},
|
||||
{`text; charset=utf-8; format=flowed; charset=utf-8`, "text", m("charset", "utf-8", "format", "flowed")},
|
||||
|
||||
// Issue #76236: '{' and '}' are token chars.
|
||||
{"attachment; filename={file}.png", "attachment", m("filename", "{file}.png")},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue