Skip to content

Commit

Permalink
Fix multipart request test with Jetty server
Browse files Browse the repository at this point in the history
  • Loading branch information
rstoyanchev committed Sep 17, 2021
1 parent 853ab5d commit 8b5f5d9
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,16 @@ public void standardMultipartResolver() throws Exception {

@Test // SPR-13319
public void standardMultipartResolverWithEncodedFileName() throws Exception {
byte[] boundary = MimeTypeUtils.generateMultipartBoundary();
String boundaryText = new String(boundary, "US-ASCII");
String boundaryText = MimeTypeUtils.generateMultipartBoundaryString();
Map<String, String> params = Collections.singletonMap("boundary", boundaryText);

String content =
"--" + boundaryText + "\n" +
"Content-Disposition: form-data; name=\"file\"; filename*=\"utf-8''%C3%A9l%C3%A8ve.txt\"\n" +
"Content-Type: text/plain\n" +
"Content-Length: 7\n" +
"\n" +
"content\n" +
"--" + boundaryText + "\r\n" +
"Content-Disposition: form-data; name=\"file\"; filename*=\"utf-8''%C3%A9l%C3%A8ve.txt\"\r\n" +
"Content-Type: text/plain\r\n" +
"Content-Length: 7\r\n" +
"\r\n" +
"content\r\n" +
"--" + boundaryText + "--";

RequestEntity<byte[]> requestEntity =
Expand Down

0 comments on commit 8b5f5d9

Please sign in to comment.