]> Cypherpunks repositories - gostls13.git/commit
mime: preserve unnecessary backslash escapes as literals
authorRuss Cox <rsc@golang.org>
Wed, 26 Oct 2016 18:32:43 +0000 (14:32 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 27 Oct 2016 17:54:59 +0000 (17:54 +0000)
commiteac59508199f77f55d986ab1a7439c7488a20650
treeeeeb5b3e8ed6504e07f574331615ccbd3da0ba26
parent2bafbe11b1389c3a589314b74ab24f936816befb
mime: preserve unnecessary backslash escapes as literals

When MSIE sends a full file path (in "intranet mode"), it does not
escape backslashes: "C:\dev\go\foo.txt", not "C:\\dev\\go\\foo.txt".

No known MIME generators emit unnecessary backslash escapes
for simple token characters like numbers and letters.

If we see an unnecessary backslash escape, assume it is from MSIE
and intended as a literal backslash. This makes Go servers deal better
with MSIE without affecting the way they handle conforming MIME
generators.

Fixes #15664.

Change-Id: Ia3b03b978317d968dc11b2f6de1df913c6bcbfcc
Reviewed-on: https://go-review.googlesource.com/32175
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/mime/mediatype.go
src/mime/mediatype_test.go