Skip to content

Commit

Permalink
[#1618] Log an error in case te request exceeds 8192 bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
Igmar Palsenberg authored and Notalifeform committed Feb 7, 2013
1 parent 7d6b980 commit 3d8af0f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions framework/src/play/server/PlayHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.jboss.netty.buffer.ChannelBufferInputStream;
import org.jboss.netty.buffer.ChannelBuffers;
import org.jboss.netty.channel.*;
import org.jboss.netty.handler.codec.frame.TooLongFrameException;
import org.jboss.netty.handler.codec.http.*;
import org.jboss.netty.handler.codec.http.websocketx.*;
import org.jboss.netty.handler.stream.ChunkedFile;
Expand Down Expand Up @@ -657,6 +658,12 @@ protected static Map<String, Http.Cookie> getCookies(HttpRequest nettyRequest) {
@Override
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception {
try {
// If we get a TooLongFrameException, we got a request exceeding 8k.
// Log this, we can't call serve500()
Throwable t = e.getCause();
if (t instanceof TooLongFrameException) {
Logger.error("Request exceeds 8192 bytes");
}
e.getChannel().close();
} catch (Exception ex) {
}
Expand Down

0 comments on commit 3d8af0f

Please sign in to comment.