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 {
6969 for (int i =33 ; i <= 126 ; i ++) {
7070 PRINTABLE .set (i );
7171 }
72+ PRINTABLE .set (34 , false ); // "
7273 PRINTABLE .set (61 , false ); // =
7374 PRINTABLE .set (63 , false ); // ?
7475 PRINTABLE .set (95 , false ); // _
Original file line number Diff line number Diff line change @@ -268,6 +268,13 @@ void formatWithFilenameWithQuotes() {
268268 tester .accept ("foo.txt\\ \\ \\ " , "foo.txt\\ \\ \\ \\ \\ \\ " );
269269 }
270270
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+
271278 @ Test
272279 void formatWithEncodedFilenameUsingInvalidCharset () {
273280 assertThatIllegalArgumentException ().isThrownBy (() ->
You can’t perform that action at this time.
0 commit comments