Skip to content

Commit

Permalink
Merge #2556 into 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
violetagg committed Oct 26, 2022
2 parents c320d3e + e201a21 commit 0296f6e
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import io.netty.handler.codec.http.multipart.FileUpload;
import io.netty.handler.codec.http.multipart.HttpDataFactory;
import io.netty.handler.codec.http.multipart.HttpPostRequestEncoder;
import io.netty.handler.codec.http.multipart.MemoryFileUpload;
import io.netty.handler.stream.ChunkedInput;
import reactor.core.Exceptions;
import reactor.core.publisher.Sinks;
Expand Down Expand Up @@ -190,7 +189,8 @@ public HttpClientForm file(String name,
if (contentType == null) {
scontentType = DEFAULT_BINARY_CONTENT_TYPE;
}
MemoryFileUpload fileUpload = new MemoryFileUpload(name,
FileUpload fileUpload = newFactory.createFileUpload(request,
name,
filename,
scontentType,
DEFAULT_TRANSFER_ENCODING,
Expand Down Expand Up @@ -283,8 +283,13 @@ public HttpClientForm textFile(String name,
scontentType = DEFAULT_TEXT_CONTENT_TYPE;
}

MemoryFileUpload fileUpload =
new MemoryFileUpload(name, "", scontentType, null, newCharset, -1);
FileUpload fileUpload = newFactory.createFileUpload(request,
name,
"",
scontentType,
null,
newCharset,
-1);
fileUpload.setMaxSize(-1);
fileUpload.setContent(stream);
addBodyHttpData(fileUpload);
Expand Down

0 comments on commit 0296f6e

Please sign in to comment.