diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java b/codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java index 88585cd965..5e1c07076a 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java +++ b/codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java @@ -110,6 +110,7 @@ public abstract class HttpObjectDecoder extends ReplayingDecoder 0; + prematureClosure = contentLength() > 0; } + reset(); if (!prematureClosure) { out.add(LastHttpContent.EMPTY_LAST_CONTENT); @@ -419,7 +418,7 @@ public abstract class HttpObjectDecoder extends ReplayingDecoder= 0) { + } else if (contentLength() >= 0) { nextState = State.READ_FIXED_LENGTH_CONTENT; } else { nextState = State.READ_VARIABLE_LENGTH_CONTENT; @@ -507,6 +506,13 @@ public abstract class HttpObjectDecoder extends ReplayingDecoder