// and intended as a literal backslash. This makes Go servers deal better
// with MSIE without affecting the way they handle conforming MIME
// generators.
- if r == '\\' && i+1 < len(v) && !isTokenChar(rune(v[i+1])) {
+ if r == '\\' && i+1 < len(v) && isTSpecial(rune(v[i+1])) {
buffer.WriteByte(v[i+1])
i++
continue
{`"\\" rest`, "\\", " rest"},
{`"My \" value"end`, "My \" value", "end"},
{`"\" rest`, "", `"\" rest`},
+ {`"C:\dev\go\robots.txt"`, `C:\dev\go\robots.txt`, ""},
+ {`"C:\新建文件件\中文第二次测试.mp4"`, `C:\新建文件件\中文第二次测试.mp4`, ""},
}
for _, test := range tests {
value, rest := consumeValue(test[0])
// Microsoft browers in intranet mode do not think they need to escape \ in file name.
{`form-data; name="file"; filename="C:\dev\go\robots.txt"`, "form-data", m("name", "file", "filename", `C:\dev\go\robots.txt`)},
+ {`form-data; name="file"; filename="C:\新建文件件\中文第二次测试.mp4"`, "form-data", m("name", "file", "filename", `C:\新建文件件\中文第二次测试.mp4`)},
}
for _, test := range tests {
mt, params, err := ParseMediaType(test.in)