The valid characters are defined in RFC 7230 and RFC 3986
报错信息
09-Apr-2019 14:55:11.427 信息 [http-nio-8089-exec-8] org.apache.coyote.http11.Http11Processor.service Error parsing HTTP request header Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level. java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986 at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:479) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:684) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748)
解决方法
1,在tomcat/conf/catalina.properties中添加下面这句话
tomcat.util.http.parser.HttpParser.requestTargetAllow=|{} org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true
2,在tomcat/conf/service.xml中在Connector标签中添加下面三个属性
URIEncoding="UTF-8"、relaxedPathChars="|{}[],"、relaxedQueryChars="[]|{}^\`"<>"
*这个是由于提交数据有特殊字符的原因,如果还有其他字符还可以往relaxedQueryChars中加。其他解决办法就是降低Tomcat8以下,和将提交的数据转码。
*以上修改只适合以下Tomcat版本 8.5.x~8.5.12 之间; 8.0.x~8.0.42 之间; 7.0.x~7.0.76 之间;
正在加载评论...
相关文章
- org.apache.tomcat.util.http.parser.Cookie.logIn...
- After eviction approximately [9,271] KB of data...
- Tomcat管理界面进行卸载部署undeploy项目时不能删...
- Maven安装与配置图文教程
- Linux下Tomcat容器启动设置时区,解决tomcat时间统...
- tomcat SSL安全证书生成 安装,并配置https协议访...
- org.apache.tomcat.util.bcel.classfile.ClassForm...
- windows电脑 Maven安装配置
- Tomcat域名或IP地址访问方式配置方法
栏目列表
推荐阅读
- 512M,2G,4G,8G服务器正确优化tomcat配置
- org.apache.tomcat.util.http.parser.Cookie.logInvalidHeader A cookie header was received
- Tomcat域名或IP地址访问方式配置方法
- tomcat,jdk如何配置环境变量
- tomcat配置多端口,线程配置,内存优化和server.xml配置
- windows电脑 Maven安装配置
- Tomcat访问Manager报403错误,org.apache.catalina.valves.RemoteAddrValve访问ip控制
- After eviction approximately [9,271] KB of data remained in the cache
- 在windows中查看和杀死tomcat进程
- 在windows服务器环境下配置tomcat服务开机自启动
- Tomcat管理界面进行卸载部署undeploy项目时不能删除jar文件
- 在Tomcat的Host中,用Parameter设置连接数据库等参数
- Java中boolean默认值与Boolean默认值是不同的
- java.lang.OutOfMemoryError: PermGen space
- jar命令替换war包中的properties文件,jar解压命令,jar打包命令
- org.apache.catalina.webresources.Cache getResource
- tomcat配置域名https证书,添加80和443端口,http重定向到https