undertow由1.6升级至2.4后访问报错

rt。前端用的是layui,访问路径为http://localhost/admin/home/

更新无法访问,报错信息如下


[ERROR]-[Thread: XNIO-1 task-2]-[io.undertow.servlet.api.LoggingExceptionHandler.handleThrowable()]: UT005023: Exception handling request to /admin/home/

java.lang.IllegalArgumentException: UT000173: An invalid control character [230] was present in the cookie value or attribute

at io.undertow.util.LegacyCookieSupport.isHttpSeparator(LegacyCookieSupport.java:149)

at io.undertow.util.Cookies.parseCookie(Cookies.java:274)

at io.undertow.util.Cookies.parseRequestCookies(Cookies.java:216)

at io.undertow.util.Cookies.parseRequestCookies(Cookies.java:206)

at io.undertow.util.Cookies.parseRequestCookies(Cookies.java:202)

at io.undertow.server.HttpServerExchange.getRequestCookies(HttpServerExchange.java:1128)

at io.undertow.server.session.SessionCookieConfig.findSessionId(SessionCookieConfig.java:84)

at io.undertow.servlet.spec.SessionCookieConfigImpl.findSessionId(SessionCookieConfigImpl.java:61)

at io.undertow.servlet.spec.ServletContextImpl$ServletContextSessionConfig.findSessionId(ServletContextImpl.java:1235)

at io.undertow.servlet.handlers.SessionRestoringHandler.handleRequest(SessionRestoringHandler.java:117)

at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:269)

at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:78)

at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:133)

at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:130)

at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)

at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)

at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:249)

at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:78)

at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:99)

at io.undertow.server.Connectors.executeRootHandler(Connectors.java:376)

at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:745)


没搞懂是什么情况

评论区

JFinal

2021-01-26 16:25

浏览器发的请求中的 cookie 值含有一些无效控制字符: "invalid control characte"

打开浏览器开发者工具,将这些 cookie 删掉即可

显然是与 undertow 无关的

zeroabc

2021-01-26 16:39

@JFinal 好家伙,删掉了cookie里面几个带繁体字的键值就可以了。。但是为什么之前的undertow 版本会没事呢,真奇怪。。谢谢詹总了

JFinal

2021-01-26 16:57

@zeroabc 之前的 undertow 版本一样有事,做事要细心

热门反馈

扫码入社