浏览器请求 tomcat 服务器地址,如果链接中带有特殊字符,比如 {},会报错:
Error parsing HTTP request header
Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.
java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
解决:
在 tomcat/conf/catalina.properties 文件,最后一行加上
tomcat.util.http.parser.HttpParser.requestTargetAllow=|{}
重启 tomcat 即可
时间: 2024-10-11 09:16:41