我正在使用Tomcat 8.在一种情况下,我需要处理来自外部源的外部请求
Tomcat不会记录请求。 在这种情况下,我收到以下错误。
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.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:467)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:667)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:789)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
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)
我想问一下,如果有什么方法可以将日志记录转到哪个字符导致此问题?此外,如果我记录请求标题,标题中的哪个字段会导致此问题。
我读了帖子Tomcat 8 is not able to handle get request with '|' in query parameters?
但添加" tomcat.util.http.parser.HttpParser.requestTargetAllow = | {}" 没工作。