File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
main/java/org/springframework/http
test/java/org/springframework/http Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ public final class ContentDisposition {
69
69
for (int i =33 ; i <= 126 ; i ++) {
70
70
PRINTABLE .set (i );
71
71
}
72
+ PRINTABLE .set (34 , false ); // "
72
73
PRINTABLE .set (61 , false ); // =
73
74
PRINTABLE .set (63 , false ); // ?
74
75
PRINTABLE .set (95 , false ); // _
Original file line number Diff line number Diff line change @@ -268,6 +268,13 @@ void formatWithFilenameWithQuotes() {
268
268
tester .accept ("foo.txt\\ \\ \\ " , "foo.txt\\ \\ \\ \\ \\ \\ " );
269
269
}
270
270
271
+ @ Test
272
+ void formatWithUtf8FilenameWithQuotes () {
273
+ String filename = "\" 中文.txt" ;
274
+ assertThat (ContentDisposition .formData ().filename (filename , StandardCharsets .UTF_8 ).build ().toString ())
275
+ .isEqualTo ("form-data; filename=\" =?UTF-8?Q?=22=E4=B8=AD=E6=96=87.txt?=\" ; filename*=UTF-8''%22%E4%B8%AD%E6%96%87.txt" );
276
+ }
277
+
271
278
@ Test
272
279
void formatWithEncodedFilenameUsingInvalidCharset () {
273
280
assertThatIllegalArgumentException ().isThrownBy (() ->
You can’t perform that action at this time.
0 commit comments