Details
Description
2010-07-21 08:18:54,061 [1430322255@qtp1-9191] WARN org.mortbay.jetty - handle failed
java.io.IOException: bad chunk char: 60
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:792)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:213)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
2010-07-21 08:18:54,082 [1430322255@qtp1-9191] WARN org.mortbay.jetty - handle failed
java.io.IOException: bad chunk char: 60
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:792)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:213)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
The problem is when HTTP request contains Transfer-Encoding: chunked in the header, but the request content is NOT chunked in fact.
It occurs when there is some intermediate gateway/proxy which can change the content of the request, but it doesn't change relevant HTTP headers.
It is very rate that clients uses Transfer-Encoding: chunked for the HTTP request, but when it is used correctly it works.
The issue was found for Jetty 6.1.14, however it may occur for the latest Jettys as well.
For me privately the issue is that the error message which says very little about the issue.
It was hard to find the original cause of the issue.
I would improve the Jetty code to handle such king of messages(described as chunked, but in fact not chunked), but I would log some warning.
However it is an enhancement to support non-standard (bad behavior), so if you decide to not do it, please improve logging to resolve such issues faster.
While I agree that a better error message would be better, there are an infinite number of ways that an illegal request can be sent and the only way we could detect this issue is by seeing illegal chunk chars... which might really be just illegal chunk chars from a bad chunking implementation.
It is impossible to come up with error messages for all such situations and to attempt to do so would slow the code.
regards