Invalid character found in the request target.The valid characters are defined in RFC 7230 and RFC3986
Tomcat在 7.0.73, 8.0.39, 8.5.7 版本后,添加了对于http头的验证。
具体来说,就是添加了些规则去限制HTTP头的规范性
参考这里
具体来说:
org.apache.tomcat.util.http.parser.HttpParser#IS_NOT_REQUEST_TARGET[]
中定义了一堆not request target
if(IS_CONTROL[i] || i > 127 || i == 32 || i == 34 || i == 35 || i == 60 || i == 62 || i == 92 || i == 94 || i == 96 || i == 123 || i == 124 || i == 125) {
IS_NOT_REQUEST_TARGET[i] = true;
}
转换过来就是以下字符(对应10进制ASCII看):
- 键盘上那些控制键:(
<32或者=127
) - 非英文字符(
>127
) 空格
(32
)双引号
(34
)#
(35
)<
(60
)>
(62
)反斜杠
(92
)^
(94
)TAB上面那个键,我也不晓得嫩个读
(96
){
(123
)}
(124
)
|
(125
)
解决办法1:
还是参考这里
即:
配置tomcat的catalina.properties
添加或者修改:
tomcat.util.http.parser.HttpParser.requestTargetAllow=|{}
这种方法只适合对应的应为,如果为中文则就不行。如果有?和&这些符合那么
tomcat.util.http.parser.HttpParser.requestTargetAllow=|{}?&
解决办法2:
最轻便的方法,更换tomcat版本。此方法比较快。
解决办法3:
对相应的参数进行编码,就是将所有的参数都进行编码
解决方法4:
选择另外的参数传递方法,比如post或者localStorage。
Invalid character found in the request target.The valid characters are defined in RFC 7230 and RFC3986的更多相关文章
- 关于toncat的Invalid character found in the request target.The valid characters are defined in RFC 7230 and RFC3986
首先这个错误通常的产生原因, 是tomcat的确收到了格式不正确的请求参数,根据tomcat的版本支持的解析,tomcat抛出这个错误. 但是还有一种就是前台发送的请求方式由 get发送导致本应pos ...
- 解决:Invalid character found in the request target.The valid characters are defined in RFC 7230 and RFC3986
目录 背景 原因分析 处理方法 参考 背景 在将tomcat升级到7.0.81版后,发现系统的有些功能不能使用了,查询日志发现是有些地址直接被tomcat认为存在不合法字符,返回HTTP 400错误响 ...
- Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC
解决Invalid character found in the request target. The valid characters are defined in RFC 7230 and RF ...
- Tomcat v7.0 java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
十二月 , :: 下午 org.apache.coyote.http11.AbstractHttp11Processor process 信息: Error parsing HTTP request ...
- 解决springboot项目请求出现非法字符问题 java.lang.IllegalArgumentException:Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
springboot版本: 2.1.5 最近使用springboot搭建了一个App后台服务的项目,开发接口的时候在本机使用postman工具做请求测试,请求返回一直很正常,但是在前端开发使用h5请求 ...
- tomcat Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
1.情景展示 tomcat 日志时不时会报出如下异常信息,到底是怎么回事? java.lang.IllegalArgumentException: Invalid character found ...
- Tomcat报错Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
问题描述:后台报错 Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.java ...
- 已解决:Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986 问题
请求: http://127.0.0.1:8080/driverApp/findLikeAddress?json={"shopname":"广东省"," ...
- IE浏览器连接WebSocket报错:java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
在项目开发中整合了WebSocket,本来没什么问题了,但是偶尔发现用IE浏览器打开web端不能推送消息,因为PC端与服务器建立连接失败了.网上查了很多资料, 又看了看源码,都不对症:又怀疑是Spri ...
随机推荐
- BZOJ1202 [HNOI2005]狡猾的商人 并查集维护前缀和
1202: [HNOI2005]狡猾的商人 Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 1935 Solved: 936[Submit][Stat ...
- doGet() throws NamingException报错
做一个通过JNDI查找资源的小练习,Context = new InitialContext(),发现NamingException异常,eclipse编辑器只有catch的提示,没有throws的提 ...
- python utc时间转换为strftime
拿来主义: from datetime import datetimefrom time import timetime_sec = time()def time2str(time_with_sec) ...
- JQuery 日期选择框
一 jeDate日期控件,关于官方的文档请查看: http://www.jayui.com/jedate/ 1 引入js文件 <script type="text/javascr ...
- CentOS下VI命令整理
Vi共分三种模式,分别是“一般模式”.“编辑模式”与“命令行命令模式”. l 一般模式:vi处理文件时,一进入该文件就是一般模式.在这个模式中,可以使用“上下左右”键来移动光标,可以使 ...
- Java IO 字节流与字符流 (五)
Java的IO流分为字符流(Reader,Writer)和字节流(InputStream,OutputStream),字节流顾名思义字节流就是将文件的内容读取到字节数组,然后再输出到另一个文件中.而字 ...
- 27. FormPanel类的defaults属性
defaults : Object defaults属性可以包含任意个name/value属性对,这些属性将会被添加到每一个元素中...例如, 为了自动向容器包含的每个Ext.Panel 元素的宽度添 ...
- 云服务器装teamviewer
[int32] EulaAccepted = 1 [int32] EulaAcceptedRevision = 6
- MySQL5.7 windows二进制安装
200 ? "200px" : this.width)!important;} --> 介绍 1.下载解压 下载地址:http://dev.mysql.com/get/Dow ...
- 清北考前刷题day6早安
#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #d ...