公司tomcat从8.0.22更换到高版本的9.0.22以后,postman请求没问题,但是终端请求总是400
报Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986错,
解决:
在tomcat的conf/server.xml 的Connector中添加:relaxedQueryChars="{}|[],%" relaxedPathChars="[]|{},%"
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000"
relaxedQueryChars="[]|{}^\`"<>" redirectPort="8443" />
有中文的话加上:URIEncoding="UTF-8"。
原文地址:https://www.cnblogs.com/onroad2019/p/11642096.html
时间: 2024-11-10 02:50:04