The valid characters are defined in RFC 7230 and RFC 3986报错处理

解决办法:

1、更换低版本Tomcat,如Tomcat7.0.69之前的版本

2、如果是Linux环境,修改部署Tomcat目录conf里的catalina.properties文件

tomcat.util.http.parser.HttpParser.requestTargetAllow=|[]{}

3、如果是window环境,存在上面修改无效的情况,此时修改Tomcat/conf里的server.xml

<Connector connectionTimeout="20000" port="8090" protocol="HTTP/1.1" relaxedQueryChars="[]|{}^&#x5c;&#x60;&quot;&lt;&gt;" redirectPort="8443"/>

增加配置:

relaxedQueryChars="[]|{}^&#x5c;&#x60;&quot;&lt;&gt;"
原文地址:https://www.cnblogs.com/x-jingxin/p/12835774.html