jeecg-domi 发表于 2018-9-18 06:24:27

关于高版本tomcat对于前端输入的url header抛出异常的问题

Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986

该问题经查询是高版本tomcat对于http头部的规范的限制,不知道论坛有没有人能解答一下如果要从代码上来解决应该怎么做。按我的理解是需要对头部进行encode处理,但是刚入门还不清楚整个代码在哪一部分是统一处理这一块的。

报错如下:
org.apache.coyote.http11.Http11Processor.service 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.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:472)
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:683)
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)
        at file:///C:\Users\win\AppData\Roaming\Tencent\TIM\Temp\%W@GJ$ACOF(TYDYECOKVDYB.pngorg.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
        at file:///C:\Users\win\AppData\Roaming\Tencent\TIM\Temp\%W@GJ$ACOF(TYDYECOKVDYB.pngorg.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)


页: [1]
查看完整版本: 关于高版本tomcat对于前端输入的url header抛出异常的问题