首页 > java > tomcat > > 正文

HTTP header parsing errors— defined in RFC 7230 and RFC 3986

发布人:zhoulujun    点击:

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

之前把顺丰金融官网改版成java,运营一年后,今天突然跳出bug了。

只知道请求参数要做限制,却forget  这么fixed了?——三四年不摸java,就后遗症一大堆

自己挖的坑死命也得填啊。


May 03, 2018 8:06:33 PM org.apache.coyote.http11.AbstractHttp11Processor process

INFO: 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

        at org.apache.coyote.http11.InternalNioInputBuffer.parseRequestLine(InternalNioInputBuffer.java:317)

        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1000)

        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)

        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1756)

        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1715)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

        at java.lang.Thread.run(Thread.java:745)

百度一搜,啥都没有

Screen Shot 2018-05-08 at 10.23.57.png

心理诅咒下GFW和坑爹的内网防火墙。接上4G找谷歌。

总结下在不升级tomcat到8.0以上的情况下

Add this line in your catalina.properties

tomcat.util.http.parser.HttpParser.requestTargetAllow=|{}

加上了,关键是我都不知道,怎么写测试用例来测试这个!


https://stackoverflow.com/questions/41053653/tomcat-8-is-not-able-to-handle-get-request-with-in-query-parameters

https://issues.alfresco.com/jira/browse/ALF-21878