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.

Closes gh-30953
This commit is contained in:
Arjen Poutsma
2023-12-06 11:51:48 +01:00
parent 2e3d13331a
commit ef4ffa0005
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);