Do not decode when the content is empty

This commit is contained in:
Trustin Lee 2010-03-31 02:48:57 +00:00
parent c1a70b3579
commit 745b8300f0

View File

@ -73,7 +73,8 @@ public abstract class HttpContentDecoder extends SimpleChannelUpstreamHandler {
contentEncoding = HttpHeaders.Values.IDENTITY;
}
if ((decoder = newContentDecoder(contentEncoding)) != null) {
boolean hasContent = m.isChunked() || m.getContent().readable();
if (hasContent && (decoder = newContentDecoder(contentEncoding)) != null) {
// Decode the content and remove or replace the existing headers
// so that the message looks like a decoded message.
m.setHeader(