gpt4 book ai didi

Tomcat.8.5.15 不接受 URI 中的 "\"并抛出 IllegalArgumentException

转载 作者:行者123 更新时间:2023-11-28 22:33:41 25 4
gpt4 key购买 nike

当我在 URI 中使用“\”作为路径定界符时,我在 tomcat 8.5.15 中收到非法参数异常。以下是错误消息:-

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 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(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)

为了绕过这个问题我尝试添加

 org.apache.catalina.connector. CoyoteAdapter.ALLOW_BACKSLASH=true

在 catalina.properties 中,我仍然无法解决问题。

最佳答案

要解决此问题,您可以设置 requestTargetAllow 选项。只需取消注释文件中的最后一行即可。

$CATALINA_HOME/conf/catalina.properties

关于Tomcat.8.5.15 不接受 URI 中的 "\"并抛出 IllegalArgumentException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45933343/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com