digdeep

凡是过去,皆是序幕。Read the fucking manual and source code.

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

Tomcat报错:The valid characters are defined in RFC 7230 and RFC 3986

原因是有个请求:

/loadxxxx.json?userid=xxx&comparestr={"aaa":"3623","bbb","isqf":"0"}&bbb=custominfo1
包含了特殊字符: { 和 }
解决方法:
1、使用 encodeURICompoment对参数进行编码;
2、在conf/catalina.properties中最后添加2行:
tomcat.util.http.parser.HttpParser.requestTargetAllow=|{},
org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true

3、使用post提交,不用把参数放到url中;

 

posted on 2021-06-09 22:48  digdeep  阅读(167)  评论(0编辑  收藏  举报
不懂数据库和Web安全的架构师不是一个好的程序员。