Skip to content

Commit 4606337

Browse files
chenggangprosdeleuze
authored andcommitted
Prevent hung uploads in MultipartParser
This commit adds an onRequest() hook to request more data from the source in order to avoid hung uploads in MultipartParser. Closes gh-34388 Signed-off-by: Gang Cheng <[email protected]>
1 parent f45a08d commit 4606337

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

spring-web/src/main/java/org/springframework/http/codec/multipart/MultipartParser.java

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ public static Flux<Token> parse(Flux<DataBuffer> buffers, byte[] boundary, int m
100100
return Flux.create(sink -> {
101101
MultipartParser parser = new MultipartParser(sink, boundary, maxHeadersSize, headersCharset);
102102
sink.onCancel(parser::onSinkCancel);
103+
sink.onRequest(l -> parser.requestBuffer());
103104
buffers.subscribe(parser);
104105
});
105106
}

0 commit comments

Comments
 (0)