undertow 报错问题

2020-05-20 09:11:21.484 ERROR 119259 --- [XNIO-1 task-58] io.undertow.request                      : UT005023: Exception handling request to /favicon.ico


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

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




2020-05-20 09:11:21.489 ERROR 119259 --- [XNIO-1 task-58] io.undertow.request                      : UT005022: Exception generating error page /error


java.lang.RuntimeException: java.lang.IllegalArgumentException: UT000173: An invalid control

2020-05-20 09:11:21.489 ERROR 119259 --- [XNIO-1 task-58] io.undertow.request                      : UT005071: Undertow request failed HttpServerExchange{ GET /error}


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

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


评论区

JFinal

2020-05-21 18:12

cookie 中有不合法字符, 打开 chrome 浏览器的开发者工具,然后鼠标右键删掉所有 cookie 即可

当然,删掉以后,要确保代码中没有 cookie 在存放非法字符

cookie 非法字符可以搜索一下

prelove

2020-11-17 16:25

用360浏览器在ie兼容模式,访问后台websocket接口很容易出现

prelove

2020-11-17 16:31

@JFinal 用IE浏览器或360浏览器兼容模式,然后请求地址的url前缀用ip访问,不要用localhost,就要出问题:
2020-11-17 16:26:58.318 [ERROR] io.undertow.request - UT005023: Exception handling request to /myapp.ws
java.lang.IllegalArgumentException: UT000173: An invalid control character [179] 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)

JFinal

2020-11-17 16:39

@prelove 什么原因造成的?

JFinal

2020-11-17 16:39

@prelove 我还是觉得是 cookie 本身的格式有问题

prelove

2020-11-18 14:03

@JFinal 360浏览器的ie兼容模式下传了个这个 theworld_client_none: ³±”¯
百度了下,跟这个说的差不多:http://shequ.mall.360.com/forum.php?mod=viewthread&tid=15329000

JFinal

2020-11-18 15:40

@prelove theworld_client_none 这个 cookie 的值应该是不符合 http 规范的,所以 undertow 在解析它的时候出了问题,记得解决以后回来分享:
https://jfinal.com/my/share/add

热门反馈

扫码入社