diff --git a/src/main/java/org/jboss/netty/handler/codec/http/DefaultHttpMessage.java b/src/main/java/org/jboss/netty/handler/codec/http/DefaultHttpMessage.java index 215f00674d..c00bfa1b70 100644 --- a/src/main/java/org/jboss/netty/handler/codec/http/DefaultHttpMessage.java +++ b/src/main/java/org/jboss/netty/handler/codec/http/DefaultHttpMessage.java @@ -113,7 +113,21 @@ public class DefaultHttpMessage implements HttpMessage { } public boolean isChunked() { - return chunked; + if (chunked) { + return true; + } + + List chunked = getHeaders(HttpHeaders.Names.TRANSFER_ENCODING); + if (chunked.isEmpty()) { + return false; + } + + for (String v: chunked) { + if (v.equalsIgnoreCase(HttpHeaders.Values.CHUNKED)) { + return true; + } + } + return false; } public void setChunked(boolean chunked) { diff --git a/src/main/java/org/jboss/netty/handler/codec/http/HttpMessageDecoder.java b/src/main/java/org/jboss/netty/handler/codec/http/HttpMessageDecoder.java index eaa8dd38a8..1b9fb1b039 100644 --- a/src/main/java/org/jboss/netty/handler/codec/http/HttpMessageDecoder.java +++ b/src/main/java/org/jboss/netty/handler/codec/http/HttpMessageDecoder.java @@ -453,7 +453,13 @@ public abstract class HttpMessageDecoder extends ReplayingDecoder= 0) { nextState = State.READ_FIXED_LENGTH_CONTENT; @@ -463,20 +469,6 @@ public abstract class HttpMessageDecoder extends ReplayingDecoder chunked = message.getHeaders(HttpHeaders.Names.TRANSFER_ENCODING); - if (chunked.isEmpty()) { - return false; - } - - for (String v: chunked) { - if (v.equalsIgnoreCase(HttpHeaders.Values.CHUNKED)) { - return true; - } - } - return false; - } - private HttpChunkTrailer readTrailingHeaders(ChannelBuffer buffer) throws TooLongFrameException { headerSize = 0; String line = readHeader(buffer);