You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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/#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"
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:
Input:
attachment; filename*="UTF-8''foo-%c3%a4.html"
expected: The parameter is invalid, thus should be ignored.
got: "foo-ä.html"
https://play.golang.org/p/wMsDdfBeh3
The text was updated successfully, but these errors were encountered: