Skip to content

Commit

Permalink
do not encode if empty content
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Trepanier authored and trustin committed Aug 1, 2011
1 parent 5579a91 commit 46c9a5f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ public void writeRequested(ChannelHandlerContext ctx, MessageEvent e)
throw new IllegalStateException("cannot send more responses than requests");
}

if ((encoder = newContentEncoder(acceptEncoding)) != null) {
boolean hasContent = m.isChunked() || m.getContent().readable();
if (hasContent && (encoder = newContentEncoder(acceptEncoding)) != null) {
// Encode the content and remove or replace the existing headers
// so that the message looks like a decoded message.
m.setHeader(
Expand Down

0 comments on commit 46c9a5f

Please sign in to comment.