2019/6/21 上午11:48:052019-06-21 11:48:05.590 [http-apr-8080-exec-3] INFO com.xxx.doFilter(CORSFilter.java:75) - CORS filter >>>>>> Because host:xxx.domain.com and origin:https://xxx.domain.com so Access-Control-Allow-Origin:https://xxx.domain.com 2019/6/21 上午11:48:05Jun 21, 2019 11:48:05 AM org.apache.coyote.http11.AbstractHttp11Processor process 2019/6/21 上午11:48:05INFO: Error parsing HTTP request header 2019/6/21 上午11:48:05 Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level. 2019/6/21 上午11:48:05java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986 2019/6/21 上午11:48:05 at org.apache.coyote.http11.InternalAprInputBuffer.parseRequestLine(InternalAprInputBuffer.java:240) 2019/6/21 上午11:48:05 at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1052) 2019/6/21 上午11:48:05 at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637) 2019/6/21 上午11:48:05 at org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:2492) 2019/6/21 上午11:48:05 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 2019/6/21 上午11:48:05 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 2019/6/21 上午11:48:05 at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) 2019/6/21 上午11:48:05 at java.lang.Thread.run(Thread.java:748)
非法参数:Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
意思说的是请求中包含了无效的字符,具体去看RFC 7230 and RFC 3986规范中的字符定义。
这个问题很纳闷!因为以前是没有遇到过的,于是先去看tomcat对RFC 7230 and RFC 3986规范的支持情况。
Tomcat从 7.0.73, 8.0.39, 8.5.7 版本后添加了对Url的限制,遵循的就是RFC 7230 and RFC 3986规范。那我们就先搞清楚规范中描述的是什么。