Support empty part in DefaultPartHttpMessageReader

This commit fixes a bug in DefaultPartHttpMessageReader's
MultipartParser, due to which the last token in a part window was not
properly indicated.

See gh-30953
Closes gh-31766
This commit is contained in:
Arjen Poutsma
2023-12-06 11:51:48 +01:00
parent a1471a9266
commit 29a39b617e
4 changed files with 38 additions and 2 deletions

View File

@@ -540,7 +540,7 @@ final class MultipartParser extends BaseSubscriber<DataBuffer> {
while ((prev = this.queue.pollLast()) != null) {
int prevByteCount = prev.readableByteCount();
int prevLen = prevByteCount + len;
if (prevLen > 0) {
if (prevLen >= 0) {
// slice body part of previous buffer, and flush it
DataBuffer body = prev.split(prevLen + prev.readPosition());
DataBufferUtils.release(prev);