diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractMemoryHttpData.java b/codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractMemoryHttpData.java index ac83db6ad9..b6aa0ccdf4 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractMemoryHttpData.java +++ b/codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractMemoryHttpData.java @@ -98,8 +98,8 @@ public abstract class AbstractMemoryHttpData extends AbstractHttpData { cbb.writerIndex(cbb.writerIndex() + buffer.readableBytes()); } else { CompositeByteBuf cbb = compositeBuffer(); - cbb.addComponent(buffer); - cbb.writerIndex(buffer.readableBytes()); + cbb.addComponents(byteBuf, buffer); + cbb.writerIndex(byteBuf.readableBytes() + buffer.readableBytes()); byteBuf = cbb; } }