当'Cookie'标头不正确时,Tomcat会抛出异常

时间:2013-02-21 14:38:02

标签: tomcat cookies

如果我发送错误的cookie值,请发送 Cookie: привет-мир!(非法俄罗斯人)tomcat将抛出异常:

Feb 21, 2013 6:29:16 AM org.apache.coyote.http11.AbstractHttp11Processor process
SEVERE: Error processing request
java.lang.IllegalArgumentException: Control character in cookie value or attribute.
    at org.apache.tomcat.util.http.CookieSupport.isHttpSeparator(CookieSupport.java:193)
    at org.apache.tomcat.util.http.Cookies.getTokenEndPosition(Cookies.java:488)
    at org.apache.tomcat.util.http.Cookies.processCookieHeader(Cookies.java:291)
    at org.apache.tomcat.util.http.Cookies.processCookies(Cookies.java:168)
    at org.apache.tomcat.util.http.Cookies.getCookieCount(Cookies.java:106)
    at org.apache.catalina.connector.CoyoteAdapter.parseSessionCookiesId(CoyoteAdapter.java:919)
    at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:688)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:402)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1600)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)

在这种情况下,我可以配置tomcat跳过cookie解析并处理请求吗?

0 个答案:

没有答案