1
0

fix: infinite loop when decoding invalid 2231 charset

This commit is contained in:
James Houlahan
2020-06-29 12:51:39 +02:00
parent 813e99f399
commit 0b0991d682
3 changed files with 7 additions and 0 deletions

View File

@ -107,6 +107,11 @@ func TestParseMediaType(t *testing.T) {
wantMediaType: "attachment",
wantParams: map[string]string{"filename": "備a忘b錄.m4a", "title": "memorandum"},
},
"Bad2231EncodingKeepsJustTitle": {
arg: "attachment;\nfilename*=utf-8'%F0%9F%98%81%F0%9F%98%82.txt;\n title=smile",
wantMediaType: "attachment",
wantParams: map[string]string{"title": "smile"},
},
}
for name, testData := range testTable {
t.Run(name, testData.run)