Skip to content

Commit

Permalink
Merge pull request #624 from hongrich/lighthouse-1692-patch
Browse files Browse the repository at this point in the history
[#1692] Don't set Content-Length on a 304 response
  • Loading branch information
pepite committed Aug 13, 2013
2 parents 5937dc6 + 2f8114d commit f6f3556
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions framework/src/play/server/PlayHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -361,12 +361,13 @@ protected static void writeResponse(ChannelHandlerContext ctx, Response response
ChannelBuffer buf = ChannelBuffers.copiedBuffer(content);
nettyResponse.setContent(buf);

if (Logger.isTraceEnabled()) {
Logger.trace("writeResponse: content length [" + response.out.size() + "]");
if (!nettyResponse.getStatus().equals(HttpResponseStatus.NOT_MODIFIED)) {
if (Logger.isTraceEnabled()) {
Logger.trace("writeResponse: content length [" + response.out.size() + "]");
}
setContentLength(nettyResponse, response.out.size());
}

setContentLength(nettyResponse, response.out.size());

ChannelFuture f = ctx.getChannel().write(nettyResponse);

// Decide whether to close the connection or not.
Expand Down

0 comments on commit f6f3556

Please sign in to comment.