解决Invalid character found in the request target. The valid characters are defined in RFC 7230 and RF
2017-07-18 22:30
405 查看
Tomcat在 7.0.73, 8.0.39, 8.5.7 版本后,添加了对于http头的验证。
具体来说,就是添加了些规则去限制HTTP头的规范性
具体来说:
转换过来就是以下字符(对应10进制ASCII看):
键盘上那些控制键:(
非英文字符(
解决办法:
还是参考这里
即:
配置tomcat的catalina.properties
添加或者修改:
tomcat.util.http.parser.HttpParser.requestTargetAllow=|{}
当然还有另外一种方法,就是将所有的参数都进行编码
具体来说,就是添加了些规则去限制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)
解决办法:
还是参考这里
即:
配置tomcat的catalina.properties
添加或者修改:
tomcat.util.http.parser.HttpParser.requestTargetAllow=|{}
当然还有另外一种方法,就是将所有的参数都进行编码
相关文章推荐
- 解决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
- 解决Invalid character found in the request target. The valid characters are defined in RFC 7230 and RF
- 解决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
- 解决Invalid character found in the request target. The valid characters are defined in RFC 7230 and RF
- Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
- invalid character found in the request target the valid characters are defined in rfc 7230 and rfc 3
- 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 RFC 3986
- Invalid character found in the request target.The valid characters are defined in RFC 7230 /RF3986
- 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 RFC
- 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 RFC
- invalid character found in the request target the valid characters are defined in rfc 7230 and rfc 3
- tomcat请求参数问题解决: Invalid character found in the request target. The valid characters are defined in
- 异常:Invalid character found in the request target. The valid characters are defined in RFC 3986
- 异常:Invalid character found in the request target. The valid characters are defined in RFC 3986
- 异常:Invalid character found in the request target. The valid characters are defined in RFC 3986