码迷,mamicode.com
首页 > 其他好文 > 详细

tomcat9以后对,请求消息头的严格字符要求

时间:2019-10-21 16:05:27      阅读:314      评论:0      收藏:0      [点我收藏+]

标签:toc   添加   rect   utf-8   消息   character   中文   请求   更换   

公司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="[]|{}^&#x5c;&#x60;&quot;&lt;&gt;"  redirectPort="8443" />

  有中文的话加上:URIEncoding="UTF-8"。

tomcat9以后对,请求消息头的严格字符要求

标签:toc   添加   rect   utf-8   消息   character   中文   请求   更换   

原文地址:https://www.cnblogs.com/onroad2019/p/11642096.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!