tomcat9.0 请求出现 不符合RFC 7230并且已被忽略

问题分析

出现这种问题,是因为各版本tomcat中对特殊字符和请求路径中携带中文参数而产生的错误提示

解决办法
1.调整tomcat版本

tomcat 7.0.76之前的版本不会出现类似问题

2.tomcat9之前,修改tomcat目录底下的/conf/catalina.properties

#tomcat.util.http.parser.HttpParser.requestTargetAllow=|

3.tomcat9之后,修改tomcat目录底下的/conf/server.xml

<Connector executor="tomcatThreadPool"
               port="80" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="443" relaxedPathChars="|{}[],%" relaxedQueryChars="|{}[],%"/>

猜你喜欢

转载自blog.csdn.net/weixin_45467975/article/details/131417012