今天在寫程序的時候遇到了“在請求目標中找到無效字符。有效字符在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="|{}[],%"/>