今天在写程序的时候遇到了“在请求目标中找到无效字符。有效字符在RFC 7230和RFC 3986中定义”的错误
后面搜了搜资料,发现需要重新修改Tomcat的配置文件,打开conf->server.xml
找到port为8080的那段代码,添加:
relaxedQueryChars="|{}[],%"
relaxedPathChars="|{}[],%"
修改后如下:
1 <Connector executor="tomcatThreadPool" 2 port="8080" protocol="HTTP/1.1" 3 connectionTimeout="20000" 4 redirectPort="8443" 5 relaxedQueryChars="|{}[],%" 6 relaxedPathChars="|{}[],%"/>