-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Description
I created a change (https://go-review.googlesource.com/c/go/+/59950)
that adds missing tests from http://greenbytes.de/tech/tc2231/
(see this TODO: https://github.com/golang/go/blob/master/src/mime/mediatype_test.go#L142)
But there are 5 tests who I not included from this site because expects a different return that is currently returned by ParseMediaType function, and I don't know if is better to fix this or not...
Four of them is related to backslash escape:
-
http://greenbytes.de/tech/tc2231/#attabspath
Input:attachment; filename="\foo.html"
expected: Either ignore the filename altogether or discard the path information.
got: "\foo.html" -
http://greenbytes.de/tech/tc2231/#attabspathwin
Input:attachment; filename="\\foo.html"
expected: Either ignore the filename altogether or discard the path information.
got: "\foo.html" -
http://greenbytes.de/tech/tc2231/#attfncontqs
Input:attachment; filename*0="foo"; filename*1="\b\a\r.html"
expected: UA should offer to download the resource as "foobar.html"
got: "foo\b\a\r.html" -
http://greenbytes.de/tech/tc2231/#attwithfn2231abspathdisguised
Input:attachment; filename*=UTF-8''%5cfoo.html
expected: Either ignore the filename altogether or discard the path information.
got: "\foo.html"
And the last is about putting encode inside quotes:
- http://greenbytes.de/tech/tc2231/#attwithfn2231quot
Input:attachment; filename*="UTF-8''foo-%c3%a4.html"
expected: The parameter is invalid, thus should be ignored.
got: "foo-ä.html"